Hex to decimal converter
0xFF is 255 in decimal: fifteen times sixteen plus fifteen. Paste any hex value, with or without 0x and in either case, and see the decimal result together with the place-value steps you can check by hand. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Hexadecimal
- 0xFF
- Input
- 0xFF
- Hex
- FF
- Hex lower
- ff
- Prefixed
- 0xFF
A hex to decimal converter turns a base-16 string into the integer you actually use in code, spreadsheets, and hardware docs. Paste a value such as FF, 0xFF, or deadbeef; the tool validates every digit, strips an optional 0x or 0X prefix, expands place values in powers of sixteen, and returns the decimal integer with a short step list you can copy into notes or tests.
What hexadecimal means and how it maps to decimal
Hexadecimal is base sixteen: each digit place is a power of sixteen, and digits run from zero through nine then A through F for ten through fifteen. The rightmost digit is sixteen to the power zero, the next is sixteen to the power one, and so on; the decimal value is the sum of each digit value times its place weight. That is why FF equals fifteen times sixteen plus fifteen, which is two hundred fifty-five, and why 0x10 equals sixteen rather than ten.
Programmers write the 0x prefix so a string of only digits is not mistaken for a decimal literal; this converter accepts the prefix when present and treats bare strings the same once digits are validated. Case does not matter: a, b, c, d, e, f and their uppercase forms are identical. Leading zeros are significant only as digit count in the expansion, not as a change of value—0x00FF and 0xFF both equal two hundred fifty-five.
Classroom worksheets and CPU manuals use hex because four bits pack into one digit, so a byte is two hex digits and a thirty-two-bit word is eight. Converting by hand is error-prone past a few places; a deterministic place-value pass removes that risk while still showing the expansion for short inputs so learners can audit the arithmetic. If any character is not a hex digit after the optional prefix is removed, conversion stops with an invalid hex digit error—there is no best-effort parsing that skips junk.
What you can do with it
Homework checks for base-16 place value
Students paste short hex literals from worksheets and compare hand-written powers of sixteen and the final decimal against a deterministic result before submitting.
Firmware and register dump normalization
Embedded pipelines turn 0x-prefixed register values from logs into decimal integers for metrics, alerts, and spreadsheet-friendly exports.
FAQ
What is hex to decimal conversion?
It evaluates a base-16 digit string with place values that are powers of sixteen and returns the equivalent base-10 integer. Digits A–F stand for ten through fifteen.
Do I need the 0x prefix?
No. The prefix is optional. Both FF and 0xFF convert to 255.
Can it handle large hex values?
Yes, up to 64 hex digits via BigInt.
Is the hex to decimal converter free?
The browser tool is free and runs locally.
Why does 0x10 equal 16 and not 10?
Because each hex place is a power of sixteen. The one sits in the sixteens place and the zero adds nothing, so 0x10 is one times sixteen, which is 16 in decimal.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/fmt/hex-decimal \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"hex":"0xFF"}'const res = await fetch("https://api.kit.forhosting.com/fmt/hex-decimal", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"hex": "0xFF"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/fmt/hex-decimal",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"hex": "0xFF"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/fmt/hex-decimal", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"hex":"0xFF"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"hex":"0xFF"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/fmt/hex-decimal", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"hex": "0xFF"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "fmt.hex_decimal",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_hex_digits | 64 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Invalid characters—letters outside A–F, spaces, underscores, or an empty 0x—raise a clear invalid_input error instead of a silent wrong number. Students checking homework, embedded engineers reading register dumps, and API clients normalizing color or memory addresses all need the same deterministic path: no network, no random seeds, no wall-clock dependence.
How to call the API and what comes back
The value may include a leading 0x or 0X; after that only characters zero through nine and A through F (any case) are allowed. Send a JSON body with one required string field hex (aliases value, text, n, and input). Absolute length is capped at sixty-four hex digits so Worker and browser responses stay bounded. On success the response echoes the trimmed input, sets hex to the uppercase digit string without prefix, hex_lower to the lowercase form, prefixed to a canonical 0x plus uppercase digits, had_prefix to whether the client sent 0x, decimal to the integer as a JSON number when it fits Number.MAX_SAFE_INTEGER or as a decimal digit string when it does not, decimal_string always to the full decimal representation, base_from sixteen and base_to ten, digit_count to the number of hex digits, message to a one-line English summary, and steps to an ordered list that records prefix handling, validation, place-value expansion, and the final decimal. Failed validation—missing hex, empty digits after 0x, spaces or underscores, characters outside the hex alphabet, or more than sixty-four digits—returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item and zero marginal unit price.
Practical tips, limits, and related searches
Prefer sending a string even when the value looks numeric: bare numbers are accepted only when they are non-negative integers written with decimal digits zero through nine, which is a convenience for small dumps, not a second radix. Do not embed spaces, commas, or underscore separators; strip them in your client before calling if your source uses grouped nibbles. Sixty-four hex digits cover two hundred fifty-six-bit integers, which is enough for most hashes truncated for display and for wide machine words; longer strings are rejected rather than silently truncated. Prefer this capability when the source is already known to be hex and you only need the decimal integer; if you must convert binary or octal as well, use a multi-base tool. For values larger than Number.MAX_SAFE_INTEGER the decimal field is a string so no mantissa rounding can corrupt low bits—always prefer decimal_string when you need a stable textual form across languages. When teaching, pair examples: 0xFF maps to two hundred fifty-five, 10 without prefix maps to sixteen (not ten), and G or 0x yields invalid_input so students see the error path. This landing targets people searching for a hex to decimal converter, hexadecimal to decimal calculator, or base-16 to base-10 tool; it is not a color picker, not a DMS angle converter, and not a general arbitrary-base calculator with a from-base parameter. Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when you fuzz invalid digits. Round-trip checks are easy: convert a known value such as deadbeef by hand or with another trusted library and confirm that decimal_string matches, then confirm that changing one letter to an invalid character flips the response to invalid_input with a message that names the bad digit.
Integration use cases
Unit tests for parsers and serializers
Generate known-good hex→decimal pairs plus deliberate invalid-digit cases so coding kata expected values stay stable across languages.
Technical questions
What happens on an invalid hex digit?
The API returns invalid_input and names the problem (for example an unexpected letter). Failed validation is never charged.