DevTools Logo

Palette Sorter

Palette Sorter

Paste hex, rgb, hsl, oklch or named colors and sort them by hue, lightness, saturation or chroma. Perceptual ordering, fully in-browser.

0 parsed
Try an example

Sorted swatches

0 colors · 0 near-duplicates

Paste a palette to get started

Hex, rgb(), hsl(), oklch() and CSS names are accepted.

Sorted output

original · 0 chars

Examples

Typical use

Input
palette-sorter inputs
Output
computed result

Preview and copied output use the same computation.

Edge case

Input
invalid or extreme input
Output
clear inline error or clamped result

Failures are visible rather than silently swallowed.

About this tool

Paste a list of colors and reorder it by hue, lightness, saturation or chroma using OKLCH. The tool preserves original tokens and never generates new colors.

Hue path sorting is paste-order independent; grays are grouped separately and alpha is respected in duplicate checks.

What this tool does not do

  • Hue path sorting is paste-order independent; grays are grouped separately and alpha is respected in duplicate checks.

How to use this tool

  1. Step 1

    Paste colors as lines, comma lists, JSON arrays or CSS declarations

  2. Step 2

    Pick a sort key and direction; wrap-aware hue path rotates at the largest gap

  3. Step 3

    Inspect the swatch rail and near-duplicate chips

  4. Step 4

    Copy or download as tokens, hex, CSS variables, JSON or OKLCH

Use cases

Everyday workflow

Paste a list of colors and reorder it by hue, lightness, saturation or chroma using OKLCH. The tool preserves

Common mistakes

Mistake:Ignoring the stated assumptions.

Fix:Read the notes in the output panel before applying the result.

Frequently asked questions

How does hue sorting handle the wrap?

Wrap-aware mode sorts hues then rotates at the largest circular gap, so reds stay together regardless of paste order.

Which color space is used?

OKLCH, a perceptually uniform space; near-duplicates use OKLab deltaE.

What input formats are accepted?

Hex, rgb, hsl, oklch, CSS names, comma lists, JSON arrays and declaration lines.

References & standards