Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Hex2NameNew to Visual Studio Code? Get it now.
Hex2Name

Hex2Name

Matt Webber

|
3 installs
| (0) | Free
Convert hex colors to their equivalent (or closest) HTML color name
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Hex2Name

Hex2Name is a Visual Studio Code extension that converts hex color values in your code to their equivalent (or closest) HTML color names regardless of file type. For hex values that do not have a direct CSS name, it finds the closest color name using the ΔE color difference formula.

Example:

/* Before */
.foo {
  background-color: #f00; /* red */
  color: #fff; /* white */
  border: 1px solid #ff5733; /* tomato-ish */
  text-shadow: 1px 1px 2px #f5fcff; /* aliceblue-ish */
}

/* After */
.foo {
  background-color: red;
  color: white;
  border: 1px solid tomato;
  text-shadow: 1px 1px 2px aliceblue;
}

Why?

Sometimes, the exact colors don't really matter (e.g. vibe coding, quick prototypes). This extension helps you quickly convert hex values to more readable color names, making your code cleaner and easier to understand at a glance.

Features

  • Converts 3-digit (#fff) and 6-digit (#ffffff) hex codes to their closest CSS color names.
  • Works on selected text or the entire document.
  • Displays the number of replacements in the status bar.

Usage

  1. Highlight a section of text or leave nothing selected to process the entire document.
  2. Run the command Hex2Name: Convert Selection or All from the Command Palette (Cmd+Shift+P).
  3. The hex codes will be replaced with their corresponding color names.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft