NewAPIVerve Academy: free courses and certifications anyone can verify.Explore the Academy →

Color Similarity Calculator API

GET

Check how closely two colors match with overall similarity scores and categories.

Color Similarity Calculator measures color similarity between two hex values. It returns an overall similarity score, a categorical match rating, and RGB and HSL channel breakdowns, while paid plans add Delta E and color distance metrics.

Try it — live request, no key required

Request
GETapi.apiverve.com/v1/colorsimilarity?color1=FF5733&color2=FF6B47
Query parameters
Verification
Format

No key required to try it. Get a key to use it in your app.

Example
{
  "status": "ok",
  "error": null,
  "data": {
    "color1": {
      "hex": "#FF5733",
      "rgb": {
        "r": 255,
        "g": 87,
        "b": 51
      },
      "hsl": {
        "h": 10.6,
        "s": 100,
        "l": 60
      }
    },
    "color2": {
      "hex": "#FF6B47",
      "rgb": {
        "r": 255,
        "g": 107,
        "b": 71
      },
      "hsl": {
        "h": 11.7,
        "s": 100,
        "l": 63.9
      }
    },
    "rgb_distance": 28.28,
    "rgb_similarity": 93.6,
    "hsl_similarity": 97.71,
    "overall_similarity": 95.65,
    "delta_e": 10.61,
    "hue_difference": 1.15,
    "saturation_difference": 0,
    "lightness_difference": 3.92,
    "similarity_category": "nearly identical",
    "are_identical": false
  }
}

About the Color Similarity Calculator API

Color Similarity Calculator compares two hex colors and tells you how close they are. It works by converting hex colors to RGB and HSL, calculating Euclidean distance in color space, and comparing hue, saturation, and lightness differences. Send color1 and color2, with or without the # prefix, and get back both colors broken out into RGB and HSL, an overall similarity percentage, a plain-language rating from very different to nearly identical, and a flag that says whether the two values are the same color.

Designers use it to catch near-duplicate swatches in a palette, to check a brand color against what a product or print proof actually shows, and to group user-chosen colors that are close enough to treat as one.

The Free plan returns the overall score, the rating and the channel breakdowns. Paid plans add the measurements behind the score: RGB distance and RGB similarity, HSL similarity, a Delta E color difference computed in CIE-LAB, and the separate hue, saturation and lightness gaps, so you can set your own color matching threshold instead of relying on the rating.

How it works

Each color1 and color2 value has its # stripped and is read as hex. Three-digit shorthand is expanded (F00 becomes FF0000) and the alpha byte of an eight-digit value is dropped, so transparency never affects the result. The channels are converted to HSL in the usual way, with hue in degrees and saturation and lightness as percentages, rounded to one decimal in the response.

rgb_distance is the straight-line distance between the two colors in 0-255 RGB space, and rgb_similarity rescales it to a percentage of the largest possible distance (black to white). hsl_similarity is built from the hue gap, measured around the color wheel so 350 and 10 degrees are 20 apart, plus the saturation and lightness gaps, each normalised to 0-1 before they are combined. overall_similarity is the plain average of those two percentages. similarity_category maps it with fixed cut-offs: 95 and above is nearly identical, 85 very similar, 70 similar, 50 somewhat similar, 30 different, and anything lower very different.

delta_e is CIE76: both colors are converted from sRGB to CIE-LAB under the D65 white point and the Euclidean distance is taken there, so it tracks perceived difference more closely than the RGB figures. All distances and percentages are rounded to two decimals. are_identical compares the normalised hex strings, so #ff0000 and FF0000 match, but a shorthand value and its six-digit form do not. On the Free plan the distance, Delta E, HSL similarity and per-channel difference fields come back null.

What people use it for

Color Matching
Find and compare similar colors for design consistency and brand compliance
Image Processing
Compare colors in images for color correction and matching operations
Design Systems
Validate color palette consistency and identify similar colors in design systems
Quality Control
Compare product colors against standards for quality assurance and brand consistency

Ways to call it

One endpoint, many ways in — REST with JSON, XML, YAML and CSV, plus GraphQL and an MCP interface for AI agents.

JSON
Default REST response
XML
Markup format
YAML
Human-readable
CSV
Tabular export
Beta
GraphQL
Query language
New
MCP
For AI agents

Other ways to use Color Similarity Calculator

Same data, same APIVerve account, same credit balance — one key works on all of them.

Questions.

Common questions about the Color Similarity Calculator API.

Read the docs →
What color formats can I pass into the calculator?
You can submit any standard hex color code, formatted either with or without a leading hash symbol. The API accepts both inputs and converts them into RGB and HSL coordinates before running the comparison algorithms.
Which comparison metrics and algorithms does the calculation use?
Color Similarity Calculator evaluates color pairs using Euclidean distance in RGB color space, HSL comparison across hue, saturation, and lightness, and Delta E for perceptual difference. It also outputs an overall combined similarity percentage and a descriptive similarity category.
Are Delta E and individual channel differences included on the Free plan?
No. The Free plan provides the overall similarity percentage, the similarity category, whether the colors are identical, and converted RGB and HSL values. Detailed breakdown metrics, including Delta E, RGB distance, RGB similarity, HSL similarity, and separate hue, saturation, and lightness differences, require any paid plan.
What would 25,000 color comparisons a month cost me?
Running 25,000 comparisons uses 25,000 credits, taking up an eighth of the 200,000 credits included in the Starter plan. On Starter, comparisons work out to about $0.15 per 1,000 calls, or $0.00015 per call. You can also test with 200 free comparisons every month.
How does the API report an exact color match?
When two identical colors are evaluated, the response sets the are_identical flag to true and reports an overall similarity score of 100 percent. On paid plans, the individual difference fields, such as hue, saturation, lightness, and RGB distance, evaluate to zero.

Ready to build with Color Similarity Calculator? Start with 200 free credits — one key unlocks all 300+ APIs.

Explore the catalog

300+ APIs on the same key and the same response shape.

Browse all APIs