Konverter HEX ↔ RGB ↔ HSL

Konversikan warna antara format HEX, RGB, dan HSL. Pratinjau langsung, preset cepat, salin nilai siap CSS. 100% sisi klien, tanpa unggahan.

Iklan
Iklan

A color converter translates colors between different format representations used in web design and digital graphics: HEX (#RRGGBB), RGB (0-255, 0-255, 0-255), HSL (hue, saturation, lightness), and HSV (hue, saturation, value). Each format describes the same color differently -- HEX is compact for CSS, HSL is intuitive for creating variations, and RGB maps directly to display hardware. This tool converts instantly as you type, entirely in your browser.

Konversi warna secara instan tanpa meninggalkan browser Anda

HEX, RGB, and HSL — all three formats update in real time as you type or pick. Copy CSS-ready values in one click. No uploads, no sign-up, no limits.

Real-time conversion
CSS-ready output
Gratis tanpa batas

Cara menggunakan

  1. 1

    Pilih Warna

    Ketik nilai HEX, sesuaikan input angka RGB/HSL, atau klik preset cepat.

  2. 2

    Lihat Pratinjau Langsung

    Sampel di bagian atas diperbarui secara instan untuk menunjukkan warna saat ini.

  3. 3

    Salin Format Apa Pun

    Gunakan tombol Salin di sebelah HEX, RGB, atau HSL untuk menyalin nilai siap CSS.

Mengapa Menggunakan Konverter Warna Ini?

Tiga Format, Satu Tampilan

HEX, RGB, dan HSL semuanya terlihat dan dapat diedit pada saat yang bersamaan — ubah satu dan yang lain diperbarui secara instan.

Output Siap CSS

Tombol salin memberi Anda string `#RRGGBB`, `rgb(r, g, b)`, atau `hsl(h, s%, l%)` yang dapat ditempel langsung ke CSS.

Preset Cepat

Mulai dari palet default Tailwind CSS atau hitam/putih murni, lalu sesuaikan dengan penggeser.

Iklan

Understanding Color Formats

HEX, RGB, HSL, and HSV explained

HEX (#RRGGBB) is the most compact color format for web design. Each pair of hexadecimal digits (00-FF) represents the intensity of red, green, and blue, respectively. The value 00 means the channel is off (black), and FF means it's at full intensity. For example, #FF0000 is pure red, #00FF00 is pure green, and #FFFFFF is white. HEX is the standard format in CSS, HTML, and design tools because it's short, unambiguous, and easy to copy-paste. Shorthand notation (#RGB) exists for colors where each pair is identical, like #F00 for red.

RGB uses decimal values (0-255) for the same three channels. It's the format that display hardware natively understands -- each pixel on an LCD or OLED screen has red, green, and blue subpixels that can be set to 256 brightness levels. RGB is also used in JavaScript's canvas API (ctx.fillStyle = 'rgb(255, 0, 0)') and in image processing libraries. RGBA adds an alpha channel (0-1 or 0-255) for transparency.

HSL (Hue, Saturation, Lightness) describes colors in a way that's more intuitive for humans. Hue is the color itself, measured as an angle on the color wheel (0掳=red, 120掳=green, 240掳=blue). Saturation is how vivid the color is (0%=gray, 100%=fully colored). Lightness is how dark or light (0%=black, 50%=normal, 100%=white). HSL makes it easy to create tints (increase lightness), shades (decrease lightness), and tones (decrease saturation) of a base color. HSV (Hue, Saturation, Value) is similar but uses Value instead of Lightness -- Value=100% means the color at full brightness, while Lightness=100% means white.

Iklan

Kapan menggunakan setiap format

Use HEX for CSS and HTML -- it's the most widely supported format and the shortest to write. Use RGB when you need to programmatically manipulate color channels (e.g., mixing two colors by averaging their RGB values) or when you need alpha transparency (rgba()). Use HSL when you need to create color variations -- for example, generating a button's hover state by increasing lightness by 10%, or creating a monochromatic color scheme by keeping hue constant and varying saturation and lightness.

HSL is particularly powerful in CSS custom properties (CSS variables). You can define -- hue: 210 and then use hsl(var(-- hue), 70%, 50%) throughout your stylesheet. Changing a single variable updates the entire color scheme -- impossible with HEX or RGB without recalculating every value. This is why modern CSS frameworks like Tailwind v4 are moving toward HSL-based color systems.

Iklan

Kasus Penggunaan Umum

Desain dengan HSL

Bangun palet warna dengan memilih hue dasar dan menyesuaikan lightness — jauh lebih mudah di HSL daripada di RGB.

Mengonversi Warna Figma ke CSS

Figma sering menampilkan HEX; CSS terkadang membutuhkan RGB atau HSL (untuk `color-mix` atau opacity). Dapatkan string yang tepat dalam satu klik.

Pemeriksaan Aksesibilitas

Pasangkan alat ini dengan Contrast Checker untuk memverifikasi bahwa pilihan warna Anda memenuhi persyaratan WCAG.

Penyesuaian Tema

Ganti dengan cepat preset Tailwind dengan warna merek kustom dan salin HEX yang dihasilkan ke konfigurasi Anda.

Bagaimana ini dibandingkan dengan konverter warna lain?

Perbandingan langsung alat konversi warna populer.

FiturNovaToolsRapidTablesW3Schools
HEX 鈫?RGB 鈫?HSL 鈫?HSVSemua formatTerbatas
Pratinjau langsung saat mengetikInstanTombol kirim
Integrasi pemilih warnaEyeDropper API
Privasi (tanpa unggah)100% lokalSisi server
Copy CSS-ready values
Berfungsi offline

Sebagian besar konverter warna online memproses konversi di server mereka. Alat kami melakukan semua perhitungan di browser Anda.

Pertanyaan yang sering diajukan

Format warna apa saja yang didukung?
HEX (mis. `#2563EB`), RGB (mis. `rgb(37, 99, 235)`), dan HSL (mis. `hsl(217, 83%, 53%)`). Ketiganya diperbarui secara bersamaan saat Anda mengubah nilai apa pun.
Apa perbedaan antara RGB dan HSL?
RGB mendeskripsikan warna berdasarkan komponen merah, hijau, dan birunya. HSL mendeskripsikannya berdasarkan hue (sudut roda warna), saturation (intensitas), dan lightness. HSL lebih intuitif untuk desainer karena Anda dapat mengubah lightness tanpa menghitung ulang yang lain.
Apakah alat ini mendukung singkatan HEX 3 digit?
Ya. Mengetik `#fff` secara otomatis diperluas menjadi `#FFFFFF`. Output selalu menggunakan bentuk 6 digit untuk kompatibilitas maksimum.
Apakah saya bisa menyalin nilai siap CSS?
Ya. Tombol Salin di sebelah setiap format memberi Anda `#2563EB`, `rgb(37, 99, 235)`, atau `hsl(217, 83%, 53%)` — siap untuk ditempel langsung ke CSS.
Apa yang terjadi jika saya mengetik nilai HEX yang tidak valid?
Bidang HEX adalah teks bebas, jadi Anda dapat mengetik apa saja, tetapi nilai RGB dan HSL hanya diperbarui ketika HEX valid. Ini memungkinkan Anda bereksperimen tanpa kehilangan warna sebelumnya.
Bagaimana cara mengonversi warna Tailwind CSS ke RGB atau HSL?
Simply type the Tailwind HEX value into the HEX field (e.g., `#2563EB` for `blue-600`). The RGB and HSL values will update instantly, and you can copy them with one click. This is useful when you need to use a Tailwind color in a context that requires RGB or HSL — for example, `color-mix(in srgb, rgb(37, 99, 235) 50%, transparent)` or `hsl(217, 83%, 53% / 0.5)` for opacity. You can also use the built-in Tailwind preset palette to start from any standard Tailwind color.
Bisakah saya menggunakan alat ini untuk membuat palet warna?
Yes. HSL is particularly well-suited for palette generation because you can fix the hue and vary lightness to create tints and shades of the same color. For example, set hue to 217 and saturation to 83%, then create five variations by changing lightness to 20%, 40%, 53%, 70%, and 90%. Each variation can be copied as a HEX value. Pair this tool with the Contrast Checker to verify that your text-background combinations meet WCAG accessibility standards.
Apakah alat ini akurat untuk pekerjaan desain profesional?
Yes. The conversion math follows the W3C CSS Color Module Level 4 specification, which is the same standard that browsers use internally. This means the values you copy from this tool will render identically in browsers, design tools like Figma and Sketch, and image editors like Photoshop. The tool does not apply gamma correction or color space conversion (sRGB to Display P3), so all values are in the standard sRGB color space, which is the default for web design.

Privasi Anda Adalah Prioritas Kami

Alat ini berjalan sepenuhnya di browser Anda. File Anda tidak diunggah, disimpan, atau dianalisis.

  • Kami tidak mengunggah, menyimpan, atau menganalisis file Anda.
  • Semua yang Anda proses tetap di perangkat Anda.
  • Tidak ada pemrosesan sisi server, penyimpanan cloud, atau analisis.

Bahkan jika koneksi internet Anda terputus, file Anda tetap aman.

Anda mungkin juga suka

Panduan terkait

Iklan