What Is the Hexadecimal Code for Black: Web Design Guide
The hexadecimal code for black is #000000. In web color notation, that means red is 00, green is 00, and blue is 00, so the screen outputs no red, no green, and no blue light.
If you're staring at Figma, VS Code, or your browser dev tools right now trying to settle on a text color, that answer gets you moving fast. But if you're building a real interface, knowing what is the hexadecimal code for black is only the first step. The better question is when to use pure black, when not to use it, and how that choice affects readability, hierarchy, and the overall feel of a product.
Your Quick Answer and What Comes Next
Most developers first meet black as a simple default. You type color: #000000; or just pick black from a design tool and move on. That's fine for a quick prototype.
Professional UI work asks for more precision.
When you choose black in a product, you're making decisions about contrast, visual weight, perceived sharpness, and how comfortable the interface feels over time. Pure black can look crisp and strong, but it can also feel severe on bright screens. A softer black can make a layout feel calmer and more refined without sacrificing legibility.
Practical rule: Treat black as a design decision, not a default setting.
That mindset matters whether you're styling body text, building a dark mode palette, or defining color tokens for a design system. A front-end developer needs to know how the color code works in CSS. A designer needs to know how that same choice changes the user's experience.
Here's the useful mental model:
- Code level: black is a specific value.
- Display level: that value controls emitted light.
- Design level: your choice affects comfort, clarity, and tone.
- Accessibility level: your text still has to remain readable against its background.
If you've ever wondered why one interface feels polished while another feels harsh, this is often part of the answer.
Decoding #000000 How Hex Color Codes Work
Hex color codes make more sense when you think of a screen as a light mixer with three controls. One controls red, one controls green, and one controls blue. The hex format records the setting for each of those controls.

The standard pattern is #RRGGBB. Each pair represents one channel. The guide to reading hex code values is useful if you're new to the notation and want to get comfortable reading colors directly in code.
According to Color Hex's explanation of #000000, black is universally represented as #000000 in the web color model, and the format follows #RRGGBB where each pair controls red, green, and blue intensity. In that system, black is created by setting all three channels to their minimum value.
Why 00 means black
In hex notation, 00 means the channel is at its minimum setting. So:
- Red:
00 - Green:
00 - Blue:
00
Put those together and you get #000000.
That means the display emits no red, no green, and no blue light. On a screen, that appears as black. It's the additive color endpoint where all light output is off.
Why FF is the opposite endpoint
At the other end, each channel can go up to FF. When red, green, and blue are all at their maximum, the result is white. That's why black and white often feel like the two anchor points of the interface palette.
A beginner mistake is treating hex values as arbitrary labels. They aren't. They're direct instructions to the display.
Think of
#000000as three light dials turned all the way down.
Why developers should care
Once you understand the structure, color stops feeling mysterious. You can scan a hex value and start predicting what it will look like. You also stop guessing when a designer hands you tokens like #1C1C1C or #282828. You can tell right away that those are near-black values, not random dark grays.
That fluency helps when you're:
- Debugging UI styles: You can spot whether a token is true black or just close.
- Building themes: You can create consistent dark and light surfaces.
- Talking with designers: You can discuss color choices precisely instead of saying “it looks darker.”
Black Represented in Other Color Models
Hex isn't the only way to define black in front-end work. You'll see the same color expressed in RGB, HSL, and the plain CSS keyword.
Figma notes in its black color reference that black is the absence of visible light in digital color systems. It corresponds to 0% red, 0% green, 0% blue, and in color notation has a hue angle of 0 degrees, saturation of 0%, and lightness of 0%, which makes it an achromatic anchor.
Black color code comparison
| Color Model | Syntax | Notes |
|---|---|---|
| Hex | #000000 |
Uses the #RRGGBB pattern. All channels are at minimum. |
| RGB | rgb(0, 0, 0) |
Each channel is set to zero, so no colored light is emitted. |
| HSL | hsl(0, 0%, 0%) |
Lightness at 0% produces black. Hue and saturation don't matter visually here. |
| CSS keyword | black |
A readable keyword when you don't need explicit numeric notation. |
When each format is useful
Hex is compact and common in design handoff. RGB is handy when you're working with JavaScript or color utilities that manipulate channel values directly. HSL is especially useful when you're building themes because changing lightness is intuitive.
For example, in HSL, once lightness reaches 0%, the result is black no matter what hue you started with. That's useful when you're generating palettes programmatically.
The CSS keyword black is valid and readable, but many teams prefer explicit values in design systems because they're easier to map to tokens and documentation.
If you're building reusable UI, consistency matters more than the notation itself.
The Professional Case for Using Near-Black
Pure black has authority. It also has edge. On a bright white background, that edge can feel harder than you want, especially for body text or dense interfaces.
That's why many product teams don't use #000000 everywhere, even though it is the purest digital black.
According to HTML Color Codes' guide to shades of black, values like #111111, #1C1C1C, and #282828 are commonly used as black variants in web and UI design for better visual softness.
Why near-black often looks better
Pure black can make text feel overly stark against a pure white surface. Near-black tones reduce that severity a bit. The result often feels smoother, more modern, and easier to look at for long reading sessions.
This matters in places like:
- Body copy: Softer dark text can feel less aggressive.
- Cards and panels: Near-black borders or surfaces create depth without looking heavy.
- Dark-themed interfaces: Layering multiple dark values creates hierarchy more elegantly than using one flat black everywhere.
If you're exploring a more dramatic visual direction, mood references can help. For example, if you're collecting inspiration for shadow-heavy palettes, textured contrasts, and dark romantic visual language, you can explore gothic style to see how black-adjacent tones shape atmosphere.
A practical developer note
CSS also supports the shorthand #000, which is the short form of #000000. It's valid, but many teams avoid mixing shorthand and full-length notation in the same codebase because consistency is easier to maintain than cleverness.
The UI design best practices article is helpful if you're setting visual rules across a product and want to align color choices with hierarchy and readability.
A polished interface rarely relies on one black. It uses a small family of dark values with clear jobs.
Using Black and Maintaining Web Accessibility
A softer black can improve the feel of an interface, but readability still comes first. That's where accessibility checks matter.

Canva's explanation of black in digital color systems states that #000000 is a 24-bit RGB triplet of (0, 0, 0) and that this creates maximal light subtraction in emissive displays. It also notes that black creates the highest possible contrast against #FFFFFF, which is why it serves as a key reference point for accessibility calculations.
The practical takeaway for UI work
Pure black on pure white gives you the strongest possible contrast reference. That doesn't automatically mean every accessible design must use that pairing. It does mean every softer choice should be tested instead of assumed.
If you switch from #000000 to a near-black for aesthetic reasons, check the combination with a contrast checker before shipping it. That's especially important for:
- Body text on white or off-white backgrounds
- Secondary text that already has less visual weight
- Disabled states and placeholders, which designers often make too faint
- Dark mode text, where the same logic applies in reverse
A simple workflow that keeps you safe
Use a contrast checker tool during design or handoff. Enter your foreground color and background color, then review whether the pairing meets your target standard.
A practical sequence looks like this:
- Pick your design intent: Decide whether you want pure black or a softer near-black.
- Test the pair: Check text color against the actual background, not an idealized one.
- Review by text role: Body copy, labels, captions, and headings don't all behave the same.
- Adjust carefully: If the contrast is weak, darken the text or lighten the surface.
- Document the final token: Put the approved value in your design system so people reuse it.
The guide to making a website accessible is a good next read if you want to connect color contrast decisions to broader accessibility practice.
Accessibility isn't separate from aesthetics. It's part of what makes the interface feel usable and trustworthy.
A designer's rule of thumb
Use the softest dark value that still performs well for the content's role. That gives you a more refined interface without drifting into low-contrast territory.
Quick Reference CSS Snippets and Final Thoughts
At code level, black is straightforward. In the HTML/CSS hex color model, Texas Wesleyan University's explanation of hex notation notes that black is specified as #000000 because the notation is #RRGGBB and each pair encodes red, green, and blue channel intensity. Setting all three channels to 00 yields the minimum possible per-channel intensity.
Copy and paste examples
body {
color: #000000;
background: #ffffff;
}
h1 {
color: rgb(0, 0, 0);
}
p {
color: hsl(0, 0%, 0%);
}
small {
color: black;
}
.article-body {
color: #1C1C1C;
}
.card {
background: #111111;
color: #ffffff;
}
What to remember in practice
- The exact hex code for black is
#000000. - It represents minimum red, green, and blue output in the web color model.
- Pure black is technically correct, but not always the best visual choice for text or UI surfaces.
- Near-black values can feel more comfortable and more polished.
- Every color choice still needs an accessibility check against its background.
The developers and designers who build strong products don't stop at correct syntax. They look at how a color behaves in the interface, how it feels on a real screen, and whether users can comfortably read it.
A color as simple as black is where that habit starts.
If your team needs help turning design decisions like this into a consistent, accessible product system, Nerdify can support web and mobile projects with UX/UI design and development expertise.