JSON Formatter
JSON Formatter for developers — instant, offline-style and privacy-safe.
Convert any CSS colour between HEX, RGB and HSL — including named colours — right in your browser. It parses your input with the browser's own colour engine.
Your browser is preparing the tool. It runs 100% locally.
Enter a colour as HEX, an rgb() value, or a CSS name, and the tool returns it in HEX, RGB and HSL, with a swatch preview. It works by handing your input to the browser's own CSS colour parser, so it understands anything CSS does — including all the named colours. Alpha is dropped from the HEX output and HSL values are rounded. It runs entirely in your browser; nothing is uploaded.
This tool takes a colour written in almost any CSS form and restates it in the three formats developers use most: HEX, rgb() and hsl(). Type a hex code, an rgb() expression, or a colour name like tomato or rebeccapurple, and all three representations appear together with a preview swatch.
It is the quick way to move a colour between notations — to get the hex for a named colour, the HSL for a hex, or the rgb() for any of them — without converting by hand.
Rather than parse the colour itself, the tool applies your input as a CSS colour to a hidden element and reads back what the browser computed, which always comes out as an rgb() value. From those red, green and blue numbers it builds the hex code and calculates the hue, saturation and lightness for the HSL form.
Using the browser's parser is what makes it so flexible: anything CSS accepts as a colour works as input, including the full set of named colours and the various numeric syntaxes. If the input is not a colour the browser recognises, the tool reports that it is unknown.
any CSS colour (HEX, rgb(), or a name) → parsed by the browser → HEX · rgb() · hsl()#2563EB → HEX #2563EB · rgb(37, 99, 235) · hsl(221, 83%, 53%) · rebeccapurple → #663399It accepts any colour the browser understands, including all named colours. Alpha (transparency) is dropped from the HEX, and the HSL numbers are rounded to whole values.
The HEX, RGB and HSL outputs are exact restatements of the same colour, so converting between them is lossless apart from HSL being rounded to whole degrees and percentages for readability.
Alpha is not carried into the HEX output. The tool reads the solid red, green and blue channels and produces a six-digit hex, so a semi-transparent input loses its transparency in the hex form. Keep the rgba() value if you need the alpha.
It relies on the browser's colour support. Every standard CSS colour works, but a very new colour syntax that an older browser does not recognise would be reported as unknown on that browser.
It does not output every format. HEX, RGB and HSL are covered, but not CMYK or newer spaces like OKLCH — for those, a dedicated colour tool is needed. This one focuses on the three common developer notations.
Find the hex code for a CSS colour name like coral or teal.
Convert a hex to rgb() or hsl() for your stylesheet.
Turn an rgb() or named colour into a clean hex.
Confirm a colour resolves to the values you expect.
To keep transparency, use the rgba() value rather than the hex. For CMYK, use an RGB-to-CMYK converter; for OKLCH or palettes, a dedicated colour tool. This converter covers the three common web notations.
Parses the colour with the browser's CSS engine, so it accepts any valid CSS colour (HEX, rgb(), or a name) and outputs HEX, RGB and HSL; honest that alpha is dropped and HSL is rounded.
JSON Formatter for developers — instant, offline-style and privacy-safe.
JSON Validator for developers — instant, offline-style and privacy-safe.
Base64 Encoder for developers — instant, offline-style and privacy-safe.
Fast, free Hash Generator that runs entirely client-side in your browser.
Fast, free UUID Generator that runs entirely client-side in your browser.
Fast, free CSS Minifier that runs entirely client-side in your browser.
It is free, private and runs entirely in your browser — no sign-up, no uploads, no limits.