Text to HTML Converter
How to Use
Overview
Pasting plain text straight into a web page looks harmless until the newlines collapse into one paragraph, angle brackets get swallowed as tags, and an ampersand starts a character entity that swallows the text after it. This converter builds three common structures from the same source. Paragraph mode wraps every non-empty line in p tags for body copy. Line-break mode inserts br between lines, which suits postal addresses and verse. List mode collects the lines into a ul with one li per line, which suits checklists and clause lists. Escaping converts ampersand, less-than, greater-than, double quote and single quote into their entities, and it should stay on whenever the text came from a user or an export. The blank-line switch decides whether runs of empty lines collapse into a single separator or survive as written.
Features
- Three structures from one dropdown: p paragraphs, br line breaks and ul list items
- Escaping covers ampersand, angle brackets and both quote characters to prevent tag injection and entity corruption
- Blank lines can be preserved or collapsed, with collapsing turning runs into one separator
- Live counters report total lines, non-empty lines and the character length of the generated HTML
- Output is shown in a read-only code block so it is never executed by the page, then copied or downloaded
- List mode adds the outer ul automatically and never leaves an orphan li for a blank line
How to use
- Paste the plain text into the input area with its original line breaks
- Choose the structure: paragraphs for prose, line breaks for addresses, list for checklists
- Keep escaping on unless the source is trusted HTML that really should pass through
- Set blank-line handling to preserved or collapsed and watch the counters change
- Copy the HTML into the editor, or download it as a snippet file that opens directly in a browser
Notes
- Never turn escaping off for text that came from a form, an export or a code sample containing angle brackets, or the tags will be injected as written
- Paragraph mode drops single line breaks, because a carriage return used only to wrap a line is not a paragraph boundary; choose line-break mode when wrapping matters
- List mode emits an unordered ul only; ordered clauses need their tags changed to ol in the editor afterwards
- Blank-line collapsing affects runs of empty lines only, so leading and trailing spaces inside a line survive and should be cleaned upstream
- The snippet carries no html, head or body wrapper, which is correct for pasting into an existing page but wrong as a standalone document
- Seeing & in the editor is expected; it renders as an ampersand and should not be edited back by hand
- Very long inputs still convert synchronously, but the generated block can be large, so export rather than back up a huge paste
- Literal tags typed into the source are escaped before output, so a paragraph that mentions p or br stays visible instead of being parsed as markup; the generated block is read-only for exactly that reason, and copying puts the escaped text on the clipboard.