Binaire / Hex / Decimale Converter

Een getal omzetten tussen binair, octaal, decimale en hexadecimale, met een uitsplitsingstabel.

Decimaal —
Binair —
Hexadecimaal —
Octaal —
Beetje lengte —

Resultaten update als u typt.

Heeft deze rekenmachine je het juiste antwoord gegeven?

Over deze rekenmachine

A binary, hex and decimal converter shows the same whole number across number bases. Computers ultimately work in binary (base 2), but programmers routinely switch between bases to make values readable: decimal (base 10) for everyday quantities, hexadecimal (base 16) for byte values and memory addresses, and octal (base 8) for things like Unix file permissions. This converter takes a whole number in any of those four bases and shows it in all four at once, along with its bit length. The digits allowed in each base go up to one less than the base — binary uses 0–1, octal 0–7, decimal 0–9 and hex 0–9 then A–F for 10–15 — and the tool rejects digits that are out of range for the base you pick.

As a worked example, the decimal value 255 is FF in hexadecimal, 377 in octal and 11111111 in binary — eight bits all set, i.e. exactly one byte at its maximum. To convert decimal to hex by hand you repeatedly divide by 16 and read the remainders from last to first; the calculator does it instantly and also accepts input prefixed with 0x (hex), 0b (binary) or 0o (octal) and handles negative numbers.

The reason hexadecimal is so common in computing is that each hex digit maps to exactly four binary bits (a nibble), so two hex digits describe one byte with no ambiguity — which is why colour codes like #FF8800, MAC addresses and memory dumps are written in hex. This tool is handy for bit masks, colour values, debugging register contents and any low-level work where you need to see the same number across bases.

Veelgestelde vragen

Hoe kan ik decimale omzetten naar hexadecimaal?

Repeatedly divide by 16 and read the remainders from last to first, using A–F for 10–15. Decimal 255 is FF in hex and 11111111 in binary.

Waarom wordt hexadecimaal gebruikt in computers?

Elke hex-cijferkaart is precies vier binaire bits, dus hex is een compacte, leesbare manier om bytewaarden en geheugenadressen te schrijven. 0xFF is één byte van alle.

Kan ik nummers invoeren met 0x, 0b of 0o prefixes?

Ja. Een voorvoegsel van 0x (hex), 0b (binair) of 0o (octaal) wordt automatisch verwijderd, zodat u de waarden rechtstreeks van code kunt plakken. Zorg ervoor dat de invoerbasis die u selecteert overeenkomt met de cijfers die u invoert.

Wat zegt de lengte van het stukje?

Het is hoeveel binaire cijfers de waarde nodig heeft. Decimal 255 is 8 bits (één byte); 256 heeft 9 bits nodig. Bitlengte is handig voor het kiezen van datatypen en het controleren of een waarde past in een byte, 16-bits woord of 32-bits register.

Wanneer wordt octal voorgeschreven?

Octal groepeert bits in drieën en verschijnt voornamelijk in Unix bestandsmachtigingen (zoals 755 of 644) en sommige legacy systemen. Elke octale cijfer kaarten tot precies drie binaire bits, de manier waarop elke hex cijfer kaarten tot vier.

Waarom kreeg ik "ongeldig nummer voor deze basis"?

Een cijfer dat u invoert is niet toegestaan in de geselecteerde basis. Bijvoorbeeld de letter F of het cijfer 8 in een binair nummer, die alleen 0 en 1 toestaat. Schakel de input basis om uw waarde te passen, of corrigeer het out-of-range cijfer.

❤️ Liefde Calculator.Free? Deel het

𝕏  X Facebook Reddit
API

Noem deze rekenmachine als een gratis JSON eindpunt.. geen sleutel nodig. Stuur de veldwaarden hieronder als query parameters of JSON. Alles wat je weglaat gebruikt dezelfde standaard als deze pagina is voorgevuld met; een onbekende parameter is een 400, nooit een stil nul. Lees de volledige API docs →

Eindpunt

GET https://calculator.free/api/v1/binary-hex/

curl

curl "https://calculator.free/api/v1/binary-hex/?value=255&base=10"

JavaScript fetch()

const r = await fetch(
  "https://calculator.free/api/v1/binary-hex/?" + new URLSearchParams({
    "value": "255",
    "base": "10"
  }));
const data = await r.json();
console.log(data.results);

De resultaten zijn schattingen voor algemene richtsnoeren, niet voor financieel, medisch of fiscaal advies.