Format Code Now
/

Base64 to Octal Converter

ED-29

Paste Base64 to see each decoded byte as an octal number from 000 to 377. Use the second button to go the other way, from octal bytes to Base64.

Runs in your browser. Nothing is uploaded.

Base64, or octal bytes for the reverse

Result

How to use it

  1. Paste the Base64 string into the input box.
  2. Choose how the bytes are separated and whether each is padded to three digits.
  3. Click Base64 to octal and copy the result.
  4. To reverse it, paste octal bytes such as 110 145 154 and click Octal to Base64.

What the octal values mean

The Base64 string is decoded to bytes first, and each byte is then written in base 8. The byte 72 (the letter H) becomes 110. This is not the same as converting the whole string to one huge octal number, which would lose the byte boundaries. Padding to three digits keeps every byte the same width, so 8 becomes 010 and the groups are easy to read or split.

Reading octal back to Base64

The reverse button reads groups of up to three octal digits separated by spaces, commas or semicolons. A leading backslash, as in C string escapes such as \101, or a 0o prefix is accepted. Any value above 377 is rejected because it does not fit in a byte. The output is standard Base64 with = padding, or the URL-safe alphabet if you choose it.

Error messages and what to do

MessageWhat it meansFix
is not an octal byteA group contains a digit outside 0 to 7 or has more than three digits.Write each byte as one to three digits from 0 to 7.
is above 377The number is larger than 255 in decimal, so it is not a single byte.Split the value into separate bytes or check the source.
No octal numbers foundThe input held no octal groups.Paste bytes such as 110 145 154 154 157.

Questions people ask

How do I convert Base64 to octal?

Paste the Base64 text and click Base64 to octal. The tool decodes it to bytes and prints each byte in base 8, padded to three digits. The result for SGVsbG8= is 110 145 154 154 157.

Why are the octal numbers at most 377?

A byte holds values from 0 to 255, and 255 in base 8 is 377. Every value in the output is therefore between 000 and 377. Anything larger in the reverse direction is rejected as not being a byte.

Can I turn octal back into Base64?

Yes, with the Octal to Base64 button. Paste bytes as octal groups separated by spaces, commas or semicolons. You can pick the standard or the URL-safe alphabet for the output, and the result has = padding.

Does this convert the Base64 string to one octal number?

No. It converts byte by byte, which is what most people need when they compare data with a log or a C string escape. A single big number would depend on the byte order and is not what this tool computes.

Does it accept URL-safe Base64?

Yes. Strings that use - and _ instead of + and / are read as URL-safe Base64, and the padding is optional. Mixing both alphabets in one string is reported as an error with the position.

About this tool

Base64 is decoded to bytes and each byte is written as its octal value, 000 to 377. This is the value of the bytes, not a conversion of the whole string as one large number. Padding to three digits keeps every byte the same width. The reverse action reads groups of up to three octal digits (a leading backslash or 0o is accepted) and writes Base64 with = padding. Output is not wrapped into lines. Standard and URL-safe Base64 are both read; the reverse action lets you choose which one to write.

Format Code Now: free, no ads, no accounts. Your input stays in your browser.