# Number base converter > How do you convert a number between bases? Convert whole numbers between binary, octal, decimal, hexadecimal and any base up to 36. Convert numbers between binary, octal, decimal, hexadecimal and any base from 2 to 36, of any size. See the same number in every common base at once. - Page: https://how.box/number-base/ - Runs entirely in the browser. - License: HowToolbox's own text and data (titles, explanations, FAQs, tool descriptions and schemas, this file) are CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/); AI training and answers are welcome. Attribute "HowToolbox (how.box)" with a link to the page used. Third-party data keeps its own terms; the name and logo are not licensed. Publisher: HowToolbox, contact@how.box. Terms: https://how.box/about/terms/ ## Inputs Answer link: https://how.box/number-base/?v={v}&from={from}&to={to}&upper={upper} - `v` (text): The number, written in the base from. Example: `255`. - `from` (whole number 2 to 36): The base the number is written in, 2–36. Example: `10`. - `to` (whole number 2 to 36): The base to convert to, 2–36. Example: `16`. - `upper` (boolean): Upper-case letters in the result: 1 or 0. Example: `false`. Example answer: https://how.box/number-base/?v=255&from=10&to=16&upper=0 A complete link carries the primary answer in the page HTML; a missing or invalid value shows the default page. ## Agent tools - `number_base_convert`: Converts a whole number of any size between bases 2 and 36 (binary, octal, decimal, hexadecimal and the rest). - MCP, one POST to https://how.box/mcp: `{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"number_base_convert","arguments":{"value":"255","from":10,"to":16,"uppercase":false}}}` - GET: https://how.box/mcp/run/number_base_convert?value=255&from=10&to=16&uppercase=false ## How it works A base says how many digits a numbering system has, and each place is worth that many times the one to its right. In decimal the places are ones, tens, hundreds. In binary they are ones, twos, fours, eights. In hexadecimal, which has 16 digits (0–9 and A–F), they are ones, sixteens, 256s and so on. Computers use binary, and hexadecimal is a compact way to write it: one hex digit is exactly four binary digits. To convert, add up each digit times the value of its place. For example hex FF is 15 × 16 + 15 = 255, which is 11111111 in binary and 377 in octal. Going the other way, divide by the new base again and again and read the remainders backwards (Knuth, The Art of Computer Programming, vol. 2, section 4.1). This tool works with whole numbers of any size, so a 64-bit or even larger value stays exact, and accepts bases from 2 to 36, where the letters a to z are the digits ten to thirty-five. You can type spaces or underscores to group digits, a minus sign, and the usual 0x, 0b and 0o prefixes. Fractions are not converted. ## FAQ **Why do programmers use hexadecimal?** It is a short way to write binary: every hex digit stands for exactly four bits, so a byte is two hex digits, such as FF. **What does the 0x in front of a number mean?** It marks a hexadecimal number in many programming languages. 0b marks binary and 0o octal. You can leave it in or out here. **Why does it say a digit is not valid?** Each base has only as many digits as its number. Base 8 has 0 to 7, so 9 cannot appear, and base 2 only has 0 and 1. Check the base the number is written in. **Does uppercase change a hexadecimal number’s value?** No. A–F and a–f represent the same digits. Uppercase changes only how the result is written. **Are negative values shown in two’s complement?** No. The converter keeps a minus sign. Two’s complement needs a chosen bit width and is not calculated here. More: [HowToolbox index](https://how.box/llms.txt) · [Agent Skill](https://how.box/skill.md) · [agent terms](https://how.box/about/agents/)