Hex-decimal converter

Convert between hexadecimal and decimal instantly

Overview

The HEX ⇄ Decimal Converter lets you instantly convert between hexadecimal (base-16) and decimal (base-10) number systems. It's a bidirectional tool essential for programming, web development, working with color codes, memory addresses, and understanding computer data at a low level.

Bidirectional
Convert HEX to decimal or decimal to HEX
Auto-convert
Results update instantly as you type
Batch processing
Convert multiple values at once
Export options
Download as TXT, CSV, or JSON
Reference table
Built-in HEX reference with common values
100% private
All processing happens in your browser

Interface overview

The HEX ⇄ Decimal Converter has a clean two-panel layout with mode selector at the top. Here's what you'll see:

1

Conversion mode selector (top)

At the top, you'll find Conversion mode: a collapsible section with two mode buttons:
HEX → DEC (# icon, Hexadecimal to decimal) - converts hex values to decimal
DEC → HEX (calculator icon, Decimal to hexadecimal) - converts decimal to hex

Click a mode button to switch. The selected mode is highlighted with a colored border.

2

Input panel (left)

The left panel is where you enter your values:
Header with keyboard icon and label (HEX Input or Decimal input depending on mode)
Action buttons: Upload, Paste, Clear
Drop zone: Drop files here or start typing
Supported formats displayed as badges - TXT, CSV

3

CONVERT button (center)

The orange CONVERT button sits between the two panels. Click it to perform the conversion.

Note: If Auto-convert is enabled (default), conversion happens automatically.

4

Swap button

Below the CONVERT button, you'll see a swap icon (⇄). Click it to swap the contents of input and output panels and switch to the opposite conversion mode.

5

Output panel (right)

The right panel shows your converted result:
Header with magic wand icon and label (Decimal output or HEX Output)
Action buttons: Copy, Download
Output area: displays Converted values will appear here... before conversion

6

Options row (bottom left)

Below the panels, you'll find checkboxes that change based on mode:

HEX → DEC mode:
Auto-convert only

DEC → HEX mode:
Auto-convert: converts automatically as you type
Uppercase HEX: outputs A-F instead of a-f
Include 0x prefix: adds "0x" before each hex value

7

Statistics (bottom right)

Four counters track your conversion in real-time:
INPUTS: number of values entered
OUTPUTS: number of values converted
ERRORS: number of invalid values
CONVERTED (orange) - successful conversions

8

Favorites (top right)

Click the heart icon in the top right corner to add HEX ⇄ Decimal Converter to your favorites for quick access from the homepage.

HEX ⇄ Decimal Converter interface showing mode selector, input/output panels, and statistics
HEX ⇄ Decimal Converter interface overview

Conversion modes

The converter offers two modes that work in opposite directions:
HEX → DEC: converts hexadecimal values to decimal numbers
DEC → HEX: converts decimal numbers to hexadecimal values

Each mode has its own specific options. The interface adapts based on which mode is selected, showing only relevant options.

HEX → DEC mode Hexadecimal to decimal

HEX → DEC mode converts hexadecimal values to their decimal equivalents. This is useful when you encounter hex values in code, memory dumps, or color codes and need to understand the actual numbers.

1

Input - Hexadecimal values

Enter hexadecimal values in the input panel. You can enter:
Plain hex - FF, 1A, DEADBEEF
With 0x prefix - 0xFF, 0x1A
With # prefix - #FF, #FF5733
Multiple values - one per line or comma-separated

Letters can be uppercase or lowercase (FF = ff).

Input panel with hexadecimal values
Input - Hexadecimal values
2

Output - Decimal numbers

The output shows decimal equivalents:
FF255
1A26
DEADBEEF3735928559
dd221

HEX to DEC conversion showing hexadecimal input and decimal output
HEX → DEC conversion
3

Available options

In HEX → DEC mode, only one option is available:
Auto-convert (checked by default) - converts automatically as you type

Auto-convert checkbox option
Available options (HEX → DEC mode)
4

Example

Input - dd
Output - 221

The hex value DD (13×16 + 13 = 221) is converted to its decimal equivalent.

HEX → DEC examples
INPUT (HEX)     OUTPUT (DECIMAL)
FF              255
1A              26
10              16
CAFEBABE        3405691582
DEADBEEF        3735928559
FFFFFFFF        4294967295

DEC → HEX mode Decimal to hexadecimal

DEC → HEX mode converts decimal numbers to hexadecimal format. Essential when you need to work with color codes, memory addresses, or binary data representations.

1

Input - Decimal numbers

Enter decimal numbers in the input panel:
Single value - 255
Multiple values - one per line or comma-separated
Only digits 0-9 are valid

Input panel with decimal numbers
Input - Decimal numbers
2

Output - Hexadecimal values

The output shows hex equivalents:
255FF (or ff or 0xFF depending on options)
16777215FFFFFF (white color in RGB)

Output panel with hexadecimal values
Output - Hexadecimal values
3

Available options

In DEC → HEX mode, three options are available:
Auto-convert: converts automatically as you type
Uppercase HEX (checked by default) - outputs FF instead of ff
Include 0x prefix: adds 0x prefix: 2550xFF

Available options checkboxes - Auto-convert, Uppercase HEX, Include 0x prefix
Available options (DEC → HEX mode)
4

Output formatting

Use the checkboxes to control output format:
Uppercase ON, prefix OFF: FF
Uppercase ON, prefix ON: 0xFF
Uppercase OFF, prefix OFF: ff
Uppercase OFF, prefix ON: 0xff

DEC → HEX examples
INPUT (DECIMAL)     OUTPUT (HEX)
255                 FF
16                  10
256                 100
65535               FFFF
16777215            FFFFFF
4294967295          FFFFFFFF

How to convert

Converting values is simple. Follow these steps:

1

Select conversion mode

Choose your direction:
HEX → DEC: if you have hexadecimal values
DEC → HEX: if you have decimal numbers

2

Enter your values

Input your values by:
Typing directly in the input panel
Pasting from clipboard (click Paste button or Ctrl+V)
Dropping a file onto the drop zone
Uploading via the Upload button

3

Configure options (DEC → HEX only)

In DEC → HEX mode, set your preferences:
Toggle Uppercase HEX for FF vs ff
Toggle Include 0x prefix for 0xFF format

4

View the result

If Auto-convert is enabled (default), the result appears immediately.

If disabled, click the orange CONVERT button.

5

Copy or export

Use the output panel buttons:
Copy: copy to clipboard
Download: opens export modal with TXT, CSV, JSON options

Batch conversion
Enter multiple values on separate lines or separated by commas. Each value is converted individually, making it easy to process lists of hex codes or decimal numbers.

Input panel actions

The input panel has three action buttons in the header (top right):

1

Upload button

Click the upload icon to open a file picker. Select a file from your computer. Supported formats:
TXT: plain text files with values
CSV: comma-separated values

2

Paste button

Click the clipboard icon to paste text from your clipboard into the input panel. Equivalent to pressing Ctrl+V (or ⌘+V on Mac).

3

Clear button

Click the trash icon (red) to clear all content from the input panel. This also clears the output and resets statistics.

Input panel action buttons - Upload, Paste, Clear
Input panel actions
Drag and drop
You can drag TXT or CSV files directly onto the input panel. Values are extracted and ready for conversion.

Output panel actions

The output panel shows your converted result with these action buttons:

1

Copy button

Click the copy icon to copy all converted values to your clipboard. A notification confirms the copy. Values are copied with line breaks between them.

2

Download button

Click the download icon (blue) to open the Export modal. This gives you multiple options for saving and sharing your results.

Output panel action buttons - Copy, Download
Output panel actions

Conversion options

The checkboxes at the bottom control conversion behavior. Available options depend on the current mode:

1

Auto-convert

Available in - Both modes
Default - Checked (enabled)

When enabled, conversion happens automatically as you:
Type in the input panel
Paste content
Upload a file
Change options

When disabled, you must click the CONVERT button.

2

Uppercase HEX

Available in: DEC → HEX mode only
Default: Checked (enabled)

When enabled, hex output uses uppercase letters: FF, DEADBEEF
When disabled, hex output uses lowercase: ff, deadbeef

Most programming conventions prefer uppercase for hex values.

3

Include 0x prefix

Available in: DEC → HEX mode only
Default: Unchecked (disabled)

When enabled, each hex value gets the 0x prefix: 0xFF, 0x1A
When disabled, plain hex is output - FF, 1A

Use the prefix when pasting into programming code (C, JavaScript, Python).

Conversion options checkboxes - Auto-convert, Uppercase HEX, Include 0x prefix
Conversion options
Optimal workflow
Enable Auto-convert for instant results as you type. Use Uppercase HEX for standard formatting and Include 0x prefix when you need programming-ready output.

Export modal Export results

Click the Download button in the output panel to open the Export modal. It offers multiple ways to save and share your converted values:

1

Export as file

Three file format options:
TXT: plain text file, one value per line
CSV: comma-separated values, compatible with Excel
JSON: structured data format for programming

2

Copy to clipboard

Click COPY RESULTS to copy all converted values to your clipboard. Same as the Copy button, but accessible from the modal.

3

Share

Click COPY SHARE LINK to copy a shareable URL. The link encodes your input values and conversion mode, so others can see the same conversion.

Perfect for sharing with colleagues or saving for later.

4

Close modal

Click the X button in the top right corner to close the modal without exporting.

Export modal with TXT, CSV, JSON buttons and Copy/Share options
Export modal

Error handling Conversion errors

When you enter invalid values, the converter shows clear error messages to help you fix the problem:

1

Error banner

Invalid values trigger a red error banner in the output panel with:
Warning icon (triangle with exclamation)
Conversion Error title
Error description (e.g., "Invalid decimal value")
X button to dismiss the error

Error banner showing conversion error message
Error banner
2

Common HEX → DEC errors

Invalid hex values include:
Non-hex characters (G, H, Z, etc.)
Special characters or spaces in the middle
Empty input

3

Common DEC → HEX errors

Invalid decimal values include:
Letters (A, B, C, etc.)
Special characters
Negative numbers (without special handling)
Non-numeric input

4

Error counter

The ERRORS counter in the statistics section tracks how many invalid values were encountered. This helps when processing large batches - you can see at a glance if some values failed.

Batch processing with errors
When converting multiple values, valid conversions still proceed even if some values are invalid. Check the ERRORS counter to see how many failed.

Statistics

Four counters in the bottom right track your conversion in real-time:

1

INPUTS

Shows the number of values entered in the input panel. Each line or comma-separated value counts as one input.

2

OUTPUTS

Shows the number of converted values in the output panel. Should match INPUTS minus ERRORS for successful conversions.

3

ERRORS

Shows the number of invalid values that couldn't be converted. Check this when processing batches to ensure all values converted successfully.

4

CONVERTED (orange)

Shows the total successful conversions in the current session. The highlight makes it easy to spot.

This counter accumulates across multiple conversions until you clear or refresh.

Statistics bar showing INPUTS, OUTPUTS, ERRORS, and CONVERTED counters
Statistics

HEX reference table Built-in reference

Below the converter, you'll find the HEX Reference table: a comprehensive guide to common hexadecimal values with their decimal equivalents and bit information.

1

8-bit and 16-bit values

The first table shows common values for 8-bit (1 byte) and 16-bit (2 byte) ranges:
0x00 = 0 (8-bit minimum)
0x0F = 15 (single hex digit max)
0x7F = 127 (signed 8-bit max)
0xFF = 255 (8-bit maximum / 1 byte)
0x100 = 256 (first 16-bit value)
0xFFFF = 65,535 (16-bit maximum)

2

32-bit and 64-bit values

The second table shows larger values:
0x10000 = 65,536 (first value over 16-bit)
0xFFFFFF = 16,777,215 (RGB color max)
0xCAFEBABE = 3,405,691,582 (Java class file magic number)
0xDEADBEEF = 3,735,928,559 (common debug marker)
0xFFFFFFFF = 4,294,967,295 (32-bit maximum)
0x100000000 = 4,294,967,296 (first 64-bit value)

3

HEX digit table

The third table shows all 16 hex digits with their decimal and binary equivalents:
0 = 0 = 0000
1 = 1 = 0001
8 = 8 = 1000
9 = 9 = 1001
A = 10 = 1010
F = 15 = 1111

Each hex digit represents exactly 4 binary bits.

4

Using the reference

Use this table to:
Quickly look up common values without converting
Understand bit boundaries (8-bit, 16-bit, 32-bit)
Learn the relationship between hex, decimal, and binary
Recognize famous hex values like CAFEBABE and DEADBEEF

HEX reference table showing common values and hex digit conversions
HEX reference table

Understanding number systems

Before diving in, let's understand the two number systems you're converting between. This knowledge helps you work more effectively with the tool.

1

Decimal (Base-10)

The number system you use every day. It has 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.

Each position represents a power of 10:
255 = (2×100) + (5×10) + (5×1)
1024 = (1×1000) + (0×100) + (2×10) + (4×1)

2

Hexadecimal (Base-16)

A number system with 16 digits: 0-9 and A-F.
A = 10, B = 11, C = 12, D = 13, E = 14, F = 15

Each position represents a power of 16:
FF = (15×16) + (15×1) = 255
10 = (1×16) + (0×1) = 16

3

Why hexadecimal exists

Computers work in binary (base-2), but binary numbers are long. Hexadecimal is compact:
Each hex digit = exactly 4 binary digits (bits)
F = 1111, A = 1010, 0 = 0000
8 bits (1 byte) = 2 hex digits (00-FF)

This makes hex perfect for memory addresses, color codes, and low-level programming.

4

Common hex prefixes

Hex numbers are often written with prefixes:
0x: programming (0xFF) - C, JavaScript, Python
#: colors (#FF0000) - CSS, design tools
h suffix: assembly (FFh)
No prefix: context-dependent

Our converter accepts values with or without these prefixes.

Quick conversion rule
To mentally convert a single hex digit: A=10, B=11, C=12, D=13, E=14, F=15. For two digits, multiply the first by 16 and add the second. FF = 15×16 + 15 = 255.

Common use cases

Here's when you'll typically need hex-decimal conversion:

Color codes
CSS uses hex colors (#FF5733). Convert to decimal RGB (255, 87, 51) for certain APIs, or convert RGB values to hex for CSS.
Memory addresses
Computer memory addresses are shown in hex (0x7FFE). Convert to decimal to calculate offsets or understand memory layout.
Programming
Many languages use hex for binary data, bitwise operations, permissions (chmod 755 = 0x1ED), and low-level programming.
MAC addresses
Network MAC addresses are in hex (00:1A:2B:3C:4D:5E). Convert individual bytes to understand or filter network traffic.
Unicode & ASCII
Character codes are often in hex. 0x41 = 65 = 'A'. Essential for encoding/decoding text and working with character sets.
Cryptography
Hash values, encryption keys, and security tokens are typically represented in hexadecimal format.

Tips & Best practices

Use 0x prefix for code
When converting for programming use, enable Include 0x prefix. This format (0xFF) is recognized by C, JavaScript, Python, and most other languages.
Uppercase for readability
Keep Uppercase HEX enabled for better readability. DEADBEEF is easier to read than deadbeef. Most conventions prefer uppercase.
Batch convert lists
Need to convert many values? Put them on separate lines or separate with commas. The converter processes all of them at once.
Use swap for verification
Click the swap button to reverse your conversion. If you get the same original value back, your conversion is correct.
Export for documentation
Use the Export modal to save conversions as CSV or JSON. Great for documenting color palettes, memory maps, or code references.
Reference table for learning
Use the built-in HEX Reference table to understand common values and bit boundaries. It's a great learning resource for understanding hex.

Frequently asked questions

The '0x' prefix indicates hexadecimal. In hex, '10' means 1×16 + 0×1 = 16. It's like how '10' in decimal means 1×10 + 0×1 = 10. Same digits, different base, different value.
Each color channel (Red, Green, Blue) has 256 values (0-255). In hex, that's exactly 00-FF - two digits per channel. A full RGB color is 6 hex digits (#RRGGBB), more compact than writing three decimal numbers.
JavaScript handles integers up to 2^53 - 1 (about 9 quadrillion, or hex 1FFFFFFFFFFFFF). For most practical purposes, this is more than enough.
Negative numbers use "two's complement" in binary. For example, -1 in 32-bit is FFFFFFFF. This basic converter handles positive integers; for signed numbers, you'd need specialized tools or manual calculation.
This tool focuses on hex↔decimal.
For binary: each hex digit = 4 binary digits
F = 1111, A = 1010, 0 = 0000
You can chain conversions: decimal → hex → binary mentally
HEX → DEC output is just numbers - there's nothing to format. DEC → HEX output can be uppercase/lowercase and with/without prefix, so those options are only shown when relevant.
These are famous 'magic numbers' in programming. 0xCAFEBABE identifies Java class files. 0xDEADBEEF is used as a debug marker in memory dumps. They spell words using hex digits A-F!
This tool handles integers only. Floating point hex representation (IEEE 754) requires specialized tools because the format is complex.
The drop zone accepts TXT and CSV files. Values should be one per line or comma-separated.
Yes, 100% private. All processing happens locally in your browser. Your values are never sent to any server. Close the tab and it's gone.

Ready to convert?

Convert between hexadecimal and decimal numbers instantly.

Open HEX ⇄ Decimal Converter

Documentation