Convert Octal to Hex
Convert octal to hex (and back) with BigInt precision, formatting options, Unix permission decode. Free, offline, client-side.
- Runs in your browser
- Nothing uploaded
- Free, no sign-up
Convert octal numbers to hexadecimal and back, with BigInt-exact arithmetic. UPPERCASE or lowercase, with or without 0x prefix, bit-width padding (8/16/32/64/custom). Single 3-4 digit octals also decode as Unix file permissions (755 → rwxr-xr-x).
How to Use Convert Octal to Hex
- Pick direction - Octal → Hex (default) or Hex → Octal. Swap ⇄ flips and pre-fills the previous result.
- Pick hex formatting. UPPERCASE renders digits A-F as capitals (the convention in addresses and hardware register dumps). Lowercase a-f is the C-source-code convention. 0x prefix on/off matches your destination syntax (C/C++/JS use
0x; some assemblers use$or trailingh). - Pick bit width - Compact gives the minimal hex (no leading zeros). 8/16/32/64-bit pad the binary and hex output so the value looks like a register dump. Custom lets you set any width up to 256 bits.
- Type your octal value(s). Default
755is the famous Unix file mode → hex0x1ED= decimal 493 = binary111101101= permissionrwxr-xr-x. Multi-line input gets a row per value. - Read the cross-reference columns. Octal, Hex, Decimal, Binary, Permission (for 3-4 digit octals). All BigInt-exact - no precision loss like
parseInt-based tools have above 2^53. - Permission panel - when input is exactly one 3-4 digit octal, a gradient panel appears below the table with the Unix permission decode (
rwxr-xr-xformat). Setuid (4)/setgid (2)/sticky (1) bits in 4-digit modes get the conventionals/S/t/Tletter substitutions. - Errors are isolated per row - invalid octal digits in one line don't kill the batch. Errors panel lists which lines failed.
- Copy or Download. Copy puts the full multi-line report on your clipboard. Download saves
octal-hex-report.txt.
Frequently Asked Questions
Why use BigInt instead of parseInt(o, 8).toString(16)?
JavaScript’s regular Number type loses integer precision above 2^53 (about 16-17 decimal digits, or 18 octal digits). For values larger than that, parseInt‘s result rounds to the nearest representable float. This tool uses BigInt('0o' + clean).toString(16) which handles any size exactly. So a 60-octal-digit input gets its full 80-hex-digit result, not silently truncated.
What’s the UPPERCASE vs lowercase convention?
No semantic difference – hex is case-insensitive. Common conventions: UPPERCASE in datasheets, hardware register dumps, assembler addresses, color codes (#FF0000); lowercase in C/C++ source (0xff), most modern style guides, and CSS. Pick whichever your destination expects. Toggle the checkbox to see the result update live.
What does the 0x prefix do?
It’s a marker signaling “the following digits are hexadecimal, not decimal” – required syntax in C/C++/Java/JS source code (int x = 0xFF;). Some assemblers use $ instead ($FF), or a trailing h (FFh). Some shell contexts don’t want any prefix at all (raw hex pipe). Toggle the checkbox to match your destination.
Why does Octal → Hex go through decimal?
Mathematically it doesn’t have to – you could group octal digits in pairs of three bits and regroup into nibbles of four. But the BigInt implementation goes via the canonical numeric value: parse the octal string as a BigInt, then format that BigInt as hex. Same result, simpler code, exact precision.
What’s the Unix permission decode for?
3-digit octals like 755 and 4-digit like 04755 are commonly file permission modes from chmod. The decoder shows the ls -l-style rwxr-xr-x form. Each octal digit = a read/write/execute triplet: 7 = rwx, 6 = rw-, 5 = r-x, etc. The leading digit of a 4-digit mode controls setuid/setgid/sticky bits.
How big can the input be?
Unlimited (BigInt). A 100-digit octal becomes a ~83-digit hex value, computed exactly. Practical use is usually under 30 digits.
What’s the relationship between octal and hex?
Both are power-of-2 bases (8 = 2³, 16 = 2⁴), so both map cleanly to binary. Octal groups bits in triples; hex in nibbles. The choice between them is historical: octal was popular when computers used 12/24/36-bit words (which factor evenly into 3s). Hex won out with 8/16/32/64-bit byte-aligned systems because hex groups byte-aligned (2 hex digits = 1 byte).
Will the bit-width padding affect the permission decode?
No – the permission decode operates on the original octal string, not the padded hex/binary. 0755 with bit width 32 still decodes as rwxr-xr-x, even though the displayed binary is 00000000000000000000000111101101 (padded).
Is my data uploaded?
No. All BigInt parsing, formatting, and permission decoding run in your browser. Open DevTools → Network and confirm zero requests fire after the page loads – even when you Convert.
Does it work offline?
Yes. Total bundle is under 22 KB. Once loaded, disconnect and keep converting. Useful for embedded-system permission audits or assembler work without internet.
Related Tools
Convert Hex to Octal →
Convert hex to octal (base 8) with BigInt precision. Prefix toggle (none/0/0o), digit grouping,…
Add Hex Numbers →
Add Hex Numbers instantly. Free, offline, client-side tool that outputs results in both hex…
ASCII to Hex Converter →
Convert ASCII to Hex - code points or UTF-8 bytes, space/comma/0x-prefixed, uppercase or lowercase.…
Base32 to Hex Converter →
Base32 to Hex Converter - pick separator, case, and prefix. Free, client-side, instant, offline,…
Base58 to Hex Converter →
Decode Bitcoin, Ripple, or Flickr Base58 strings to hex - with separator, case, and…
Base64 to Hex Decoder →
Decode Base64 to hex bytes - URL-safe variant, separator options, uppercase toggle, UTF-8 aware.…
BCD to Hex Converter →
Convert packed BCD to hexadecimal - decimal-value or nibble mode, BigInt precision, COMP-3 sign.…
Convert Decimal to Hex →
Convert decimal numbers to hexadecimal instantly, individually or in bulk. Free, client-side converter with…
Convert Gray Code to Hex →
Decode Gray code (reflected binary) to hex, decimal, or binary. Accepts binary or hex-packed…
Convert Hex to ASCII →
Decode hexadecimal bytes to ASCII text. Auto-detect separators, handle non-printable bytes four ways, batch…
Convert Hex to BCD →
Convert hex to Binary Coded Decimal - packed, unpacked, or COMP-3 with sign nibble.…
Convert Hex to Binary →
Convert hex to binary with nibble-accurate bit widths. 5 grouping modes, 0b prefix toggle,…