TOP

Free browser converter

ASCII to Octal Converter

Convert ASCII text to octal values in your browser with explicit ASCII, Unicode code point, and UTF-8 byte handling.

No signupFree online conversion

Interactive tool

Convert ASCII text to octal values

Ready

Mode and output format

Choose the exact representation you need; the tool does not guess an encoding.

Detailed conversion guide

How to Convert ASCII to Octal

ASCII assigns each character a number from 0 through 127. Converting that number from base 10 to base 8 produces its octal form. This page pads each result to three digits, so uppercase A becomes 101 and a space becomes 040.

Strict ASCII mode marks any character beyond U+007F instead of inventing an encoding. UTF-8 mode first encodes the text into bytes and then writes every byte as a three-digit octal value.

InputOutputMeaning
A65101
a97141
048060
space32040

ASCII to Octal in JavaScript and Python

JavaScript can read a character value and call toString(8); Python can use ord and format(value, '03o'). Both implementations must reject values above 127 when the promised output is standard ASCII.

// validate first, then convert
const value = Number.parseInt(token, radix);
if (!Number.isInteger(value)) throw new Error("Invalid input");

Three-Digit Octal and UTF-8 Bytes

Standard ASCII occupies octal 000 through 177. Values 200 through 377 are byte values but are not standard ASCII characters.

A non-ASCII character may require several UTF-8 bytes. For example, é becomes octal 303 251 in UTF-8 mode rather than a single ASCII value.

Related converters

Choose the converter for the direction and representation you need.

Advertisement

Sponsored link