---
title: "Discord Role Color: Hex to Decimal for the API | VulCode"
description: "A Discord role color is stored as one decimal number. Pick a color or type a hex code and get the value for the API or an embed. Free, in your browser."
url: "https://vulcode.com/en/tools/discord-role-color"
lang: "en"
---

[Home](https://vulcode.com/en) [Resources](https://vulcode.com/en/resources) [Tools](https://vulcode.com/en/tools)

# Discord role color

A Discord role color is stored as one decimal number. Pick a color or type a hex code and get the value for the API or an embed. Free, in your browser.

[Free quote](https://vulcode.com/en/quote) [Full pricing](https://vulcode.com/en/services/pricing)

Hex Pick the role colour

Hex is 3 or 6 characters, for example #414df2.

Turquoise

Green

Blue

Purple

Pink

Yellow

Orange

Red

Grey

Steel

VulCode

Black

## The number for the Discord API

4279794

Copy

Enter a valid hex

Discord reads 0 as no colour. For black use #000001, which is 1.

- Hex
  `#414DF2`
  Copy

- RGB
  `65, 77, 242`
  Copy

## A name with this role

Moderator dark

Contrast with the background: **2.1:1**

Moderator light

Contrast with the background: **5.9:1**

## How to use it in three steps

Step by step, with this page's example.

- Pick a color or type a hex code.

- Read the decimal number.

- Paste it into the color field in the API or an embed.

What you enter

#414df2

What you get

```
4279794
```

## Questions

- **How do I change a role color on Discord?**: Open Server Settings, Roles, pick the role and set the color on the Display tab. The number from this tool is only needed when you set the color through the API or a bot.
- **How do I convert a hex code to a color for the Discord API?**: Type the hex code or pick a color. The tool gives the decimal number, for example #414df2 is 4279794, which you paste into the color field.
- **Why does the API want a number instead of hex?**: Discord stores a color as one RGB integer. Hex #414df2 and 4279794 are the same value written two ways.
- **What does color 0 mean?**: For a role, 0 means no color, so the name keeps the default. Pure black is 1.

## Related tools

The tool does one job. If the same thing should happen automatically in your bot, server or system, we build it.

- ### [Discord webhook and embed](https://vulcode.com/en/tools/discord-webhook-embed-builder)
  Build an embed with a preview, copy the JSON or send it to a webhook.

- ### [Discord permissions calculator](https://vulcode.com/en/tools/discord-permissions-calculator)
  Click permissions and get the bitfield for a role or a bot invite.

- ### [Color contrast checker, palette and gradient](https://vulcode.com/en/tools/color-tools)
  WCAG contrast with AA and AAA thresholds, the dominant colors of an image and a CSS gradient with a Tailwind class.

- ### [Discord bots](https://vulcode.com/en/services/discord-bots)
  When the same thing should happen automatically in your bot, server or system.

## Tell us what you want to build.

A free quote comes back within an hour during working hours. You talk to the person who writes the code.

[Free quote](https://vulcode.com/en/quote) [Free consultation](https://vulcode.com/en/consultation)

- [hello@vulcode.com](mailto:hello@vulcode.com)

- [+48 576 043 920](tel:+48576043920)

- [discord.gg/vulcode](https://discord.gg/vulcode)
