Skip to main content

Plain Text — Characters Without Document Markup

Plain text represents characters without assigning HTML elements, fonts, or document styles to them. It can still contain paragraphs, indentation, delimiters, and metadata expressed as text. A receiver needs to know both the character encoding and any conventions used inside the file.

This makes plain text useful for logs, source files, text analysis, and interfaces that accept strings. It does not make every conversion to text lossless.

From ASCII to Unicode

ASCII began as a 1963 standard and evolved into the familiar 7-bit repertoire. Its 128 values include 95 printable characters and 33 controls; the 1967 revision added lowercase letters.12

Later systems used additional encodings for characters outside that repertoire. IBM Code Page 437 included accented letters and box-drawing symbols.3 ISO 8859-1, ISO 8859-2, Windows-1252, KOI8-R, Shift_JIS, EUC-JP, GB2312, and GBK served different language and platform needs. Decoding bytes with the wrong encoding can produce mojibake, or garbled text.

Unicode established a shared character repertoire rather than a separate code page for each environment. Its history began in the late 1980s; the Consortium formed in 1991 and published the first volume of Unicode 1.0 that October.45 As a historical reference, Unicode 16.0, released September 10, 2024, encoded 154,998 characters in 168 scripts.6

A code point identifies an encoded character: A is U+0041 and is U+3042. Encoding forms determine how those values become code units and bytes.

Choose and declare the encoding

FormRepresentation of a Unicode scalar value
UTF-8One to four bytes; ASCII retains its original one-byte values
UTF-16One or two 16-bit code units
UTF-32One 32-bit code unit

Accented characters such as é take more than one byte in UTF-8. A user-perceived character may contain several scalar values, so fixed-width UTF-32 does not provide fixed-width indexing of displayed characters.7

Rob Pike's account traces UTF-8's design to his work with Ken Thompson on Plan 9 in September 1992.8 UTF-8 is widely used on the web; W3Techs tracks its adoption. Avoid inferring a particular file's encoding from its popularity.

UTF-8 has no byte-order ambiguity. Its optional BOM is the U+FEFF signature encoded as EF BB BF. UTF-16 and UTF-32 byte order can be established by a BOM or by an explicit encoding label or enclosing protocol; a BOM is not invariably required. Follow the receiving format's rules, especially for scripts whose first bytes have special meaning.7

Files, media types, and newlines

.txt is a filename convention, not an encoding declaration. A file with that suffix can use UTF-8, a legacy code page, or another encoding. Preserve or record the encoding when exchanging files.

The MIME type text/plain describes text without interpretation of embedded formatting. RFC 2046 defines its MIME charset behavior, including the historical US-ASCII default; declare the intended charset rather than relying on assumptions.9

Line-ending conventions also differ:

  • Windows commonly uses CRLF, \r\n.
  • Unix, Linux, and current macOS commonly use LF, \n.
  • Classic Mac OS used CR, \r.

Line-ending conversion can affect hashes, diffs, and tools that interpret exact bytes. Git's core.autocrlf participates in this conversion, so distinguish repository bytes from a checked-out file when exact identity matters.

Select text for the task

Plain text removes markup syntax, which can be useful for a text-only consumer. It also loses information: heading levels, link destinations, and element relationships may no longer be distinguishable. Compare Markdown, readable HTML, and Minified HTML when those details matter.

For embeddings, classification, or retrieval, evaluate the actual model and corpus. There is no general rule that a model cannot use formatting or that every remaining text token is useful. Measure outputs with the downstream tokenizer and check task quality. The format comparison explains these choices.

Markdownee's TXT output

Markdownee uses Crawlee to fetch pages and Trafilaturacore to clean and select content. Its conversion package then walks the cleaned HTML to produce TXT. Paragraph and list separation remain, preformatted text is preserved, and table cells use pipe delimiters. Heading levels and ordinary link URLs are not retained as HTML markup.

The default minimal layout contains body text. standard and enhanced can prepend metadata front matter. This is a Markdownee TXT convention, not a property of all text/plain documents. Python Trafilatura has its own output API.10

When optional Markdown discovery accepts a representation published by the origin, TXT is produced from its cleaned, derived HTML. The selected format stays TXT; its content source changes.

For the Apify Actor, add txt-kvs to store text in the key-value store or txt-dataset to place it in the record. These format-destination tokens can coexist with other formats; the default save route is markdown-kvs. In the playground, select Plain text, then copy or download the returned .txt content.

Citations

  1. IEEE History Center: American Standard Code for Information Interchange ASCII, 1963. Retrieved April 14, 2026

  2. RFC 20: ASCII format for Network Interchange. Retrieved April 14, 2026

  3. IBM: Code Page 437. Retrieved April 14, 2026

  4. Unicode Consortium: History of Unicode. Retrieved April 14, 2026

  5. Unicode Consortium: Version One Chronology. Retrieved April 14, 2026

  6. Unicode Consortium: Unicode 16.0.0. Retrieved April 14, 2026

  7. Unicode Consortium: FAQ — UTF-8, UTF-16, UTF-32 & BOM. Retrieved April 14, 2026 2

  8. Rob Pike: UTF-8 history. Retrieved April 14, 2026

  9. RFC 2046: Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types. Retrieved April 14, 2026

  10. Trafilatura: Python Usage Documentation. Retrieved April 14, 2026

Updated: September 7, 2026