encyclopegia.org

Binary-to-text encoding

A binary-to-text encoding is a data encoding scheme that represents binary data as plain text. Generally, the binary data consists of a sequence of arbitrary 8-bit byte (a.k.a. octet) values and the text is restricted to the printable character codes of commonly-used character encodings such as ASCII. In general, arbitrary binary data contains values that are not printable character codes, so software designed to only handle text fails to process such data. Encoding binary data as text allows information that is not inherently stored as text to be processed by software that otherwise cannot process arbitrary binary data. The software cannot interpret the information, but it can perform useful operations on the data such as transmit and store. PGP documentation ( ) uses the term "ASCII armor" for binary-to-text encoding when referring to Base64. Conceptually, binary-to-text encoding differs from numeric representation for a numeric base (radix). For example, decimal is a scheme for representing a value as base-10, but it is not a binary-to-text encoding. A binary-to-text encoding could be devised that uses decimal representation for encoded data, but such a system would use only 10 values of a 4-bit encoded sequence, leaving 6 values unused. A more efficient encoding would use all 16 values. This is Base16 which uses hexadecimal for encoding each 4-bit sequence.…

A binary-to-text encoding is a data encoding scheme that represents binary data as plain text. Generally, the binary data consists of a sequence of arbitrary 8-bit byte (a.k.a. octet) values and the text is restricted to the printable character codes of commonly-used character encodings such as ASCII. In general, arbitrary binary data contains values that are not printable character codes, so software designed to only handle text fails to process such data. Encoding binary data as text allows information that is not inherently stored as text to be processed by software that otherwise cannot process arbitrary binary data. The software cannot interpret the information, but it can perform useful operations on the data such as transmit and store. PGP documentation ( ) uses the term "ASCII armor" for binary-to-text encoding when referring to Base64. Conceptually, binary-to-text encoding differs from numeric representation for a numeric base (radix). For example, decimal is a scheme for representing a value as base-10, but it is not a binary-to-text encoding. A binary-to-text encoding could be devised that uses decimal representation for encoded data, but such a system would use only 10 values of a 4-bit encoded sequence, leaving 6 values unused. A more efficient encoding would use all 16 values. This is Base16 which uses hexadecimal for encoding each 4-bit sequence. Notably, because 16 is a power of two, Base16 and hexadecimal are indistinguishable in practice even though they differ conceptually. Escape encodings such as percent-encoding and quoted-printable also allow for representing arbitrary binary data as text, but in a significantly different way. A binary-to-text encoding involves encoding an entire input sequence whereas an escape encoding allows for embedding binary data in data that is already and inherently text. ==Use== ===Transmitting binary data as text=== A binary-to-text encoding enables transmitting data on a communication channel that does not allow arbitrary binary data (such as email or NNTP) or is not 8-bit clean. The encoding enables transmitting binary data over a communications protocol that is designed to carry human-readable (i.e. English language) text. Often such a protocol only supports 7-bit character values (and within that avoids certain control codes), and may require line breaks at certain maximum intervals, and may not maintain whitespace. Thus, only the 94 printable ASCII characters are safe to use to convey data. The ASCII text-encoding standard uses 7 bits to encode characters. With this it is possible to encode 128 (i.e. 2 7 ) unique values (0–127) to represent the alphabetic, numeric, and punctuation characters commonly used in English, plus a selection of non-printable control characters. For example, the capital letter A is represented as 65 (41 16 , 100 0001 2 ), the numeral 2 is 50 (32 16 , 011 0010 2 ), the right curly brace } is 125 (7D 16 , 111 1101 2 ), and the carriage return control character CR is 13 (0D 16 , 000 1101 2 ). In contrast, most computers store data in memory organized in eight-bit bytes (a.k.a. octets). Files that contain machine-executable code and non-textual data typically contain all 256 possible eight-bit byte values. Many computer programs came to rely on this distinction between seven-bit text and eight-bit binary data, and would not function properly if non-ASCII characters appeared in data that was expected to include only ASCII text. For example, if the value of the eighth bit is not preserved, the program might interpret a byte value above 127 as a flag telling it to perform some function. It is often desired to send non-textual data through a text-based system, such as attaching an image to an e-mail message. To accomplish this, the data is encoded in some way, such that 8-bit data is encoded as 7-bit ASCII characters (generally using only alphanumeric and punctuation characters—the ASCII printable characters). Upon arrival at its destination, it is then decoded back to its 8-bit form. This process is referred to as binary to text encoding. Many programs perform this conversion to allow for data-transport, such as PGP and GNU Privacy Guard. ===Encoding plain text=== Binary-to-text encoding methods are also used as a mechanism for encoding plain text. Some systems have a more limited character set they can handle; not only are they not 8-bit clean, some cannot even handle every printable ASCII character. Other systems have limits on the number of characters that may appear between line breaks, such as the "1000 characters per line" limit of some Simple Mail Transfer Protocol software, as allowed by . Still others add headers or trailers to the text. A few poorly-regarded but still-used protocols use in-band signaling, causing confusion if specific patterns appear in the message. The best-known is the string "From " (including trailing space) at the beginning of a line, used to separate mail messages in the mbox file format. By using a binary-to-text encoding on messages that are already plain text, then decoding on the other end, one can make such systems appear to be completely transparent. This is sometimes referred to as 'ASCII armoring'. For example, the ViewState component of ASP.NET uses base64 encoding to safely transmit text via HTTP POST, in order to avoid delimiter collision. ==Examples== The table below describes notable binary-to-text encodings. The efficiency listed is the ratio between the number of bits in the input and the number of bits in the encoded output. For any encoding that maps n input possibilities into one 8-bit character, the efficiency is log2(n)/8. Some older and today uncommon formats include BOO (a base64), BTOA (vaguely-defined "binary to ascii", historically base85, today in JavaScript base64), and USR encoding. Base64 (with many variants including uuencoding) maps sequences of 6 bits to printable characters. Since there are more than 2 6  = 64 printable characters, this is possible. A given sequence of bytes is translated by viewing it as a stream of bits, breaking this stream into chunks of 6 bits and generating the sequence of corresponding characters. The different encodings differ in the mapping between sequences of bits and characters and in how the resulting text is formatted. Some encodings (the original version of BinHex and the recommended encoding for CipherSaber) use four bits instead of six, mapping all possible sequences of 4 bits onto the 16 standard hexadecimal digits. Using 4 bits per encoded character leads to a 50% longer output than base64, but simplifies encoding and decoding—expanding each byte in the source independently to two encoded bytes is simpler than base64's expanding 3 source bytes to 4 encoded bytes. Out of PETSCII's first 192 codes, 164 have visible representations when quoted: 5 (white), 17–20 and 28–31 (colors and cursor controls), 32–90 (ascii equivalent), 91–127 (graphics), 129 (orange), 133–140 (function keys), 144–159 (colors and cursor controls), and 160–192 (graphics). This theoretically permits encodings, such as base128, between PETSCII-speaking machines.

References

  1. Technical FAQ - InChI Trust · retrieved 2021-01-07 · rev 1376550984
    Cite this reference

    MLA "Technical FAQ - InChI Trust." 2021-01-07. http://www.inchi-trust.org/technical-faq/#13.1. Accessed 24 November 2026.

    Chicago "Technical FAQ - InChI Trust." 2021-01-07. http://www.inchi-trust.org/technical-faq/#13.1.

    APA encyclopegia.org. (2021). Technical FAQ - InChI Trust. Retrieved November 24, 2026, from http://www.inchi-trust.org/technical-faq/#13.1

  2. Base-122 Encoding · retrieved 2026-11-18 · rev 1376550984
    Cite this reference

    MLA "Base-122 Encoding." Albertson, Kevin (Nov 26, 2016). 2026-11-18. http://blog.kevinalbs.com/base122. Accessed 24 November 2026.

    Chicago "Base-122 Encoding." Albertson, Kevin (Nov 26, 2016). 2026-11-18. http://blog.kevinalbs.com/base122.

    APA Albertson, Kevin (Nov 26, 2016). (2026). Base-122 Encoding. Retrieved November 24, 2026, from http://blog.kevinalbs.com/base122

  3. bitcoin/bips · retrieved 2026-11-18 · rev 1376550984
    Cite this reference

    MLA "bitcoin/bips." 2026-11-18. https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki#bech32. Accessed 24 November 2026.

    Chicago "bitcoin/bips." 2026-11-18. https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki#bech32.

    APA encyclopegia.org. (2026). bitcoin/bips. Retrieved November 24, 2026, from https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki#bech32

  4. Payment encoding in the Lightning RFC repo · retrieved 2026-11-18 · rev 1376550984
    Cite this reference

    MLA "Payment encoding in the Lightning RFC repo." Rusty Russell ; et al. 2026-11-18. https://en.wikipedia.org/wiki/Rusty_Russell. Accessed 24 November 2026.

    Chicago "Payment encoding in the Lightning RFC repo." Rusty Russell ; et al. 2026-11-18. https://en.wikipedia.org/wiki/Rusty_Russell.

    APA Rusty Russell ; et al. (2026). Payment encoding in the Lightning RFC repo. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/Rusty_Russell

  5. Bech32m format for v1+ witness addresses · retrieved 2026-11-18 · rev 1376550984
    Cite this reference

    MLA "Bech32m format for v1+ witness addresses." 2026-11-18. https://github.com/sipa/bips/blob/bip-bech32m/bip-0350.mediawiki. Accessed 24 November 2026.

    Chicago "Bech32m format for v1+ witness addresses." 2026-11-18. https://github.com/sipa/bips/blob/bip-bech32m/bip-0350.mediawiki.

    APA encyclopegia.org. (2026). Bech32m format for v1+ witness addresses. Retrieved November 24, 2026, from https://github.com/sipa/bips/blob/bip-bech32m/bip-0350.mediawiki

  6. A Convention for Human-Readable 128-bit Keys · retrieved 2026-11-18 · rev 1376550984
    Cite this reference

    MLA "A Convention for Human-Readable 128-bit Keys." RFC 1751 "A Convention for Human-Readable 128-bit Keys" Wikipedia revision 1376550984, retrieved 2026-11-19. 2026-11-18. https://en.wikipedia.org/wiki/RFC_(identifier). Accessed 24 November 2026.

    Chicago "A Convention for Human-Readable 128-bit Keys." RFC 1751 "A Convention for Human-Readable 128-bit Keys" Wikipedia revision 1376550984, retrieved 2026-11-19. 2026-11-18. https://en.wikipedia.org/wiki/RFC_(identifier).

    APA RFC 1751 "A Convention for Human-Readable 128-bit Keys" Wikipedia revision 1376550984, retrieved 2026-11-19. (2026). A Convention for Human-Readable 128-bit Keys. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/RFC_(identifier)

  7. Boo File Format, Encoding and Decoding · retrieved 2026-11-18 · rev 1376550984
    Cite this reference

    MLA "Boo File Format, Encoding and Decoding." 2026-11-18. https://www.columbia.edu/kermit/ftp/ckermit/ckboo.txt. Accessed 24 November 2026.

    Chicago "Boo File Format, Encoding and Decoding." 2026-11-18. https://www.columbia.edu/kermit/ftp/ckermit/ckboo.txt.

    APA encyclopegia.org. (2026). Boo File Format, Encoding and Decoding. Retrieved November 24, 2026, from https://www.columbia.edu/kermit/ftp/ckermit/ckboo.txt

  8. Commodore 64 PETSCII codes · retrieved 2026-11-18 · rev 1376550984
    Cite this reference

    MLA "Commodore 64 PETSCII codes." 2026-11-18. https://sta.c64.org/cbm64pet.html. Accessed 24 November 2026.

    Chicago "Commodore 64 PETSCII codes." 2026-11-18. https://sta.c64.org/cbm64pet.html.

    APA encyclopegia.org. (2026). Commodore 64 PETSCII codes. Retrieved November 24, 2026, from https://sta.c64.org/cbm64pet.html

  9. Encoding for QR code generation automatically selects the Alphanumeric encoding to match the input character set, encoding 2 alphanumeric characters in 11 bits, and Base45 encodes 16 bits into 3 such characters. The efficiency is thus 32 bits of binary data encoded in 33 bits: 97%. Wikipedia revision 1376550984, retrieved 2026-11-19 · retrieved 2026-11-18 · rev 1376550984
    Cite this reference

    MLA "Encoding for QR code generation automatically selects the Alphanumeric encoding to match the input character set, encoding 2 alphanumeric characters in 11 bits, and Base45 encodes 16 bits into 3 such characters. The efficiency is thus 32 bits of binary data encoded in 33 bits: 97%. Wikipedia revision 1376550984, retrieved 2026-11-19." Encoding for QR code generation automatically selects the Alphanumeric encoding to match the input character set, encodi. 2026-11-18. https://en.wikipedia.org/w/index.php?oldid=1376550984. Accessed 24 November 2026.

    Chicago "Encoding for QR code generation automatically selects the Alphanumeric encoding to match the input character set, encoding 2 alphanumeric characters in 11 bits, and Base45 encodes 16 bits into 3 such characters. The efficiency is thus 32 bits of binary data encoded in 33 bits: 97%. Wikipedia revision 1376550984, retrieved 2026-11-19." Encoding for QR code generation automatically selects the Alphanumeric encoding to match the input character set, encodi. 2026-11-18. https://en.wikipedia.org/w/index.php?oldid=1376550984.

    APA Encoding for QR code generation automatically selects the Alphanumeric encoding to match the input character set, encodi. (2026). Encoding for QR code generation automatically selects the Alphanumeric encoding to match the input character set, encoding 2 alphanumeric characters in 11 bits, and Base45 encodes 16 bits into 3 such characters. The efficiency is thus 32 bits of binary data encoded in 33 bits: 97%. Wikipedia revision 1376550984, retrieved 2026-11-19. Retrieved November 24, 2026, from https://en.wikipedia.org/w/index.php?oldid=1376550984

  10. The Base45 Data Encoding · retrieved 2026-11-18 · rev 1376550984
    Cite this reference

    MLA "The Base45 Data Encoding." Fältström, Patrik; Ljunggren, Freik; Gulik, Dirk-Willem van (2022-08-11). 2026-11-18. https://rfc-editor.org/rfc/rfc9285. Accessed 24 November 2026.

    Chicago "The Base45 Data Encoding." Fältström, Patrik; Ljunggren, Freik; Gulik, Dirk-Willem van (2022-08-11). 2026-11-18. https://rfc-editor.org/rfc/rfc9285.

    APA Fältström, Patrik; Ljunggren, Freik; Gulik, Dirk-Willem van (2022-08-11). (2026). The Base45 Data Encoding. Retrieved November 24, 2026, from https://rfc-editor.org/rfc/rfc9285

  11. Base-56 Integer Encoding in PHP · retrieved 2026-11-18 · rev 1376550984
    Cite this reference

    MLA "Base-56 Integer Encoding in PHP." Duggan, Ross (August 18, 2009). 2026-11-18. http://rossduggan.ie/blog/codetry/base-56-integer-encoding-in-php/index.html. Accessed 24 November 2026.

    Chicago "Base-56 Integer Encoding in PHP." Duggan, Ross (August 18, 2009). 2026-11-18. http://rossduggan.ie/blog/codetry/base-56-integer-encoding-in-php/index.html.

    APA Duggan, Ross (August 18, 2009). (2026). Base-56 Integer Encoding in PHP. Retrieved November 24, 2026, from http://rossduggan.ie/blog/codetry/base-56-integer-encoding-in-php/index.html

  12. BaseXML - for XML1.0+ · retrieved 2026-11-18 · rev 1376550984
    Cite this reference

    MLA "BaseXML - for XML1.0+." "BaseXML - for XML1. 2026-11-18. https://github.com/kriswebdev/BaseXML. Accessed 24 November 2026.

    Chicago "BaseXML - for XML1.0+." "BaseXML - for XML1. 2026-11-18. https://github.com/kriswebdev/BaseXML.

    APA "BaseXML - for XML1. (2026). BaseXML - for XML1.0+. Retrieved November 24, 2026, from https://github.com/kriswebdev/BaseXML

  13. A Proposal of Substitute for Base85/64 – Base91 · retrieved 2026-11-18 · rev 1376550984
    Cite this reference

    MLA "A Proposal of Substitute for Base85/64 – Base91." Dake He; Yu Sun; Zhen Jia; Xiuying Yu; Wei Guo; Wei He; Chao Qi; Xianhui Lu. 2026-11-18. https://www.iiis.org/CDs2010/CD2010SCI/CCCT_2010/PapersPdf/TB100QM.pdf. Accessed 24 November 2026.

    Chicago "A Proposal of Substitute for Base85/64 – Base91." Dake He; Yu Sun; Zhen Jia; Xiuying Yu; Wei Guo; Wei He; Chao Qi; Xianhui Lu. 2026-11-18. https://www.iiis.org/CDs2010/CD2010SCI/CCCT_2010/PapersPdf/TB100QM.pdf.

    APA Dake He; Yu Sun; Zhen Jia; Xiuying Yu; Wei Guo; Wei He; Chao Qi; Xianhui Lu. (2026). A Proposal of Substitute for Base85/64 – Base91. Retrieved November 24, 2026, from https://www.iiis.org/CDs2010/CD2010SCI/CCCT_2010/PapersPdf/TB100QM.pdf

  14. binary to ASCII text encoding · retrieved 2023-03-19 · rev 1376550984
    Cite this reference

    MLA "binary to ASCII text encoding." 2023-03-19. https://base91.sourceforge.net/. Accessed 24 November 2026.

    Chicago "binary to ASCII text encoding." 2023-03-19. https://base91.sourceforge.net/.

    APA encyclopegia.org. (2023). binary to ASCII text encoding. Retrieved November 24, 2026, from https://base91.sourceforge.net/

  15. Convert binary data to a text with the lowest overhead · retrieved 2026-11-18 · rev 1376550984
    Cite this reference

    MLA "Convert binary data to a text with the lowest overhead." 2026-11-18. https://web.archive.org/web/20251028101859/https://vorakl.com/articles/base94/. Accessed 24 November 2026.

    Chicago "Convert binary data to a text with the lowest overhead." 2026-11-18. https://web.archive.org/web/20251028101859/https://vorakl.com/articles/base94/.

    APA encyclopegia.org. (2026). Convert binary data to a text with the lowest overhead. Retrieved November 24, 2026, from https://web.archive.org/web/20251028101859/https://vorakl.com/articles/base94/

  16. The S/KEY One-Time Password System · retrieved 2026-11-18 · rev 1376550984
    Cite this reference

    MLA "The S/KEY One-Time Password System." a b RFC 1760 "The S/KEY One-Time Password System". 2026-11-18. https://en.wikipedia.org/wiki/RFC_(identifier). Accessed 24 November 2026.

    Chicago "The S/KEY One-Time Password System." a b RFC 1760 "The S/KEY One-Time Password System". 2026-11-18. https://en.wikipedia.org/wiki/RFC_(identifier).

    APA a b RFC 1760 "The S/KEY One-Time Password System". (2026). The S/KEY One-Time Password System. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/RFC_(identifier)

  17. A nomenclature for sequence-based forensic DNA analysis · retrieved 2026-11-18 · rev 1376550984
    Cite this reference

    MLA "A nomenclature for sequence-based forensic DNA analysis." Young, Brian; Faris, Tom; Armogida, Luigi (2019). 2026-11-18. https://www.sciencedirect.com/science/article/pii/S1872497319300997. Accessed 24 November 2026.

    Chicago "A nomenclature for sequence-based forensic DNA analysis." Young, Brian; Faris, Tom; Armogida, Luigi (2019). 2026-11-18. https://www.sciencedirect.com/science/article/pii/S1872497319300997.

    APA Young, Brian; Faris, Tom; Armogida, Luigi (2019). (2026). A nomenclature for sequence-based forensic DNA analysis. Retrieved November 24, 2026, from https://www.sciencedirect.com/science/article/pii/S1872497319300997

Cite this article

MLA

"Binary-to-text encoding." encyclopegia.org, 2026, https://encyclopegia.org/wiki/binary-to-text-encoding. Accessed 24 November 2026.

Chicago

"Binary-to-text encoding." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/binary-to-text-encoding.

APA

encyclopegia.org. (2026). Binary-to-text encoding. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/binary-to-text-encoding

Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON

CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1376550984 · 0.5 · snapshot enwiki-001376550984

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.