Converting HTML to Text with Lynx

How Lynx's dump mode turns HTML into plain text: what changes, the most useful commands, and where the output holds up or breaks down after copying and sharing.

Lynx is a text-mode web browser. Its dump mode renders an HTML page as formatted plain text and writes the result to standard output, so it is often used to turn web pages or local HTML files into readable text inside scripts. This review explains what that conversion changes, which commands matter, and where the output stays usable. No sample pages, outputs or version-specific tests were supplied. The behavior described here comes from Lynx's documented options, so check it against your installed version.

Short verdict

Lynx is a good fit when you want a human-readable text version of an article-like page. Paragraphs, headings, lists and link text come through in reading order, and a single command produces the result. The main tradeoff is that the output is laid out for a fixed-width terminal screen rather than built as clean data. It contains hard line breaks, space-based indentation, link markers and simplified tables. Choose a different approach when you need text that reflows, preserved structure, specific fields pulled from the page, or content that only appears after JavaScript runs.

What the conversion actually changes

This transformation does not reverse or mirror text, and it does not apply a decorative Unicode font. Lynx removes the markup and renders the document, and the result is new text with different characters. It is not a visual layer like CSS. Whatever you copy from the output file is exactly what Lynx wrote.

  • Tags and attributes are removed, and text content is kept in source order.
  • Block elements become line structure: paragraphs are separated by blank lines, and list items get bullet or number markers with space indentation.
  • Lines are wrapped at a fixed column width, which inserts real newline characters. The -width option changes that width.
  • Link text stays in place. In a default dump, each link is followed by a bracketed number, and a numbered list of link addresses appears at the end. The -nolist option suppresses that list.
  • Images are replaced by their alt text or by a placeholder.
  • Scripts are not executed and most styling is ignored. Content inserted by JavaScript is missing, and content hidden with CSS may appear.
  • Tables are linearized or approximated, so complex tables can lose their row and column relationships.
  • Character entities are decoded. Characters that the output character set cannot represent may be replaced with approximations.

Commands worth knowing

# Render a local file to text
lynx -dump page.html > page.txt

# Same, without the numbered link list
lynx -dump -nolist page.html > page.txt

# Wider lines and UTF-8 output
lynx -dump -width=120 -display_charset=utf-8 page.html > page.txt

# Read HTML from standard input
cat page.html | lynx -stdin -force_html -dump > page.txt

# Fetch a page by address and render it
lynx -dump "ADDRESS" > page.txt

# Print only the links found on a page
lynx -dump -listonly "ADDRESS"

The -listonly option is the most direct way to pull web addresses out of a page, because it skips the body text and prints only the reference list. Options and defaults can differ between versions and builds, so confirm them with lynx -help or the manual page before you script around them.

Will the text stay readable after copying or sharing?

Line breaks are the biggest practical issue. Every wrapped line ends in a newline, so text pasted into an email, word processor or content editor will not reflow. It looks ragged on narrow screens and awkward on wide ones. A larger -width value reduces the number of breaks but does not remove them. To get reflowable paragraphs, post-process the output to join the lines within each paragraph, keeping in mind that list and indentation structure depends on leading spaces.

Alignment relies on spaces in a monospaced layout. In a proportional font, indented lists and rendered tables can lose their alignment, and tables suffer most.

Inline link numbers interrupt the prose and mean nothing without the list at the end. If you plan to share excerpts, use -nolist or strip the markers afterward.

Plain text has no semantic heading, list or table markup. As a result, assistive technology cannot offer navigation by heading or by table cell, and the content can only be read linearly. That works for short prose but is costly for long or table-heavy documents. This is a general consequence of losing structure. It is not the result of a test with any particular screen reader, because none was supplied. If accessible sharing matters, keep the original HTML or convert to a format that keeps structure.

Search and editing mostly work, with one catch: a multi-word phrase split across a line break may not match tools that search for the exact phrase with a space. Encoding needs attention too. Non-Latin scripts such as Cyrillic, and accented letters, can come out approximated or garbled if the output character set does not match. Set -display_charset to UTF-8, and if a page does not declare its encoding, use -assume_charset.

When plain text from Lynx is the right choice

  • Good fit: reading or archiving articles as text, comparing page content over time with diff tools, feeding readable text into grep or similar tools, plain-text email, and quick previews in a terminal.
  • Poor fit: pages built by JavaScript, documents whose tables or heading hierarchy must survive, text that must reflow without post-processing, and extracting specific fields, where an HTML parser is more reliable.

Gaps in this review

No measured results are reported here, because no sample pages, outputs or version details were available. Before you rely on Lynx for a workflow, run it on representative pages. Check how it handles tables, non-Latin text and links, and paste the output into the destination where it will actually be used.