Color Format Converter
#3498dbrgb(52, 152, 219)hsl(204, 70%, 53%)Color(red: 0.204, green: 0.596, blue: 0.859)<color name="color">#3498DB</color>Color(0xFF3498DB)Related external sites
Some links are affiliate links.
Related tools
Paste a color in HEX, RGB, or HSL and this converter shows it in every common format — HEX, RGB, HSL, HSV, and CMYK — and generates copy-ready code for CSS, SwiftUI, Android, and Flutter. It's aimed at developers who need the same color in another syntax. Everything runs in your browser.
How to use
- Paste a color as HEX, rgb() or hsl().
- Read the values in each format from the live preview.
- Copy the snippet for the platform you're working in.
How it works
The input is parsed into red, green, and blue components, whatever syntax you used. From those values the tool computes the other models: HSL and HSV describe hue, saturation and lightness/value, while CMYK is the print-oriented cyan-magenta-yellow-black model. Each platform snippet is then written in that language's exact syntax, so you can paste it straight into your code.
Features
Five color models
See HEX, RGB, HSL, HSV and CMYK for any color at once.
Copy-ready code
Get CSS, SwiftUI, Android XML and Flutter snippets.
Flexible input
Accepts HEX (3 or 6 digits), rgb() and hsl() syntax.
Private & instant
All conversion runs in your browser; nothing is uploaded.
When to use it
Web development
Switch a color between hex, rgb() and hsl() for CSS.
Mobile apps
Get the right color literal for SwiftUI, Android or Flutter.
Read the CMYK breakdown for print-oriented work.
Design to code
Translate a design color into the exact code you need.
Notes
- HSV is also called HSB in some design tools.
- CMYK here is a simple conversion, not a color-managed profile.
- Android and Flutter snippets assume a fully opaque color.
- All conversion runs on your device; nothing is uploaded.
FAQ
- What input formats are accepted?
- HEX (3 or 6 digits, with or without #), rgb()/rgba(), and hsl()/hsla() syntax.
- What's the difference from a basic color converter?
- This tool focuses on developer output — ready-to-paste code for CSS, SwiftUI, Android and Flutter, plus HSV and CMYK.
- Is the CMYK accurate for printing?
- It's a standard mathematical conversion. For exact print output, use a color-managed profile from your print provider.
- What is HSV?
- Hue, Saturation, Value — a model some design tools call HSB. It's handy for picking and adjusting colors.
- Is my color uploaded?
- No. Everything is converted in your browser and nothing leaves your device.