Guide · Text → HTML

Blank lines and paragraphs in HTML

Text pasted straight into a page collapses into one block, because HTML ignores your newlines. Every run of whitespace is one space as far as a browser is concerned.

Two rules decide the whole result: blank lines separate paragraphs, and single newlines are yours to choose about. Everything else follows from those.

Open the converter

A blank line between paragraphs

One blank line between two blocks of text produces two <p> elements. That's the only paragraph rule there is, and it's the same convention every plain-text email has used for thirty years.

In HTML itself, empty lines in the source are ignored — a browser collapses any run of whitespace to a single space — so pressing Enter in your markup adds no visible gap. Paragraph spacing comes from the <p> tags themselves; a single <br> only breaks a line. This converter turns each blank line in your text into a real <p> break so you don't hand-write any of that.

A line with spaces or tabs on it still counts as blank. Several blank lines in a row still make one break, not empty paragraphs.

If your text has no blank lines at all, you get one long paragraph — correctly, since there was nothing to split on. The converter says so when it spots that, rather than letting you find out later.

Text
First thought.

Second thought.
HTML
<p>First thought.</p>
<p>Second thought.</p>

Single newlines: <br> or a space

Inside a paragraph, a single newline can go one of two ways, and the right answer depends entirely on what the text is.

Keep them as <br> for anything where the line ending is meaningful: an address, a poem, a signature block, song lyrics. Let the text flow — newlines become spaces — for prose that was hard-wrapped at 72 columns by an old editor. Leaving those as <br> gives you a paragraph with a ragged right edge that won't reflow on a phone.

Text
12 Bridge Street
Manchester
HTML, breaks kept
<p>12 Bridge Street<br>
Manchester</p>

Turning bare URLs into links

With linking on, anything starting http://, https:// or www. becomes an <a>. Email addresses become mailto: links.

The matching is deliberately narrow. A bare example.com is not linked, because there's no way to tell it from a sentence that ends in a filename or an abbreviation with a dot in it. Guessing wrong there produces links to nowhere.

Trailing punctuation is left out of the link, so a URL at the end of a sentence doesn't swallow the full stop. Links get rel="noopener nofollow" and don't open in a new tab.

What plain text can't tell the converter

Everything here becomes a paragraph. There is no other output, and that's a property of the input rather than a shortcoming.

A line starting with a hyphen looks like a list to you, but it's a hyphen and a space. Underlining a line with equals signs looks like a heading, but it's a row of equals signs. Guessing would be wrong often enough to be worse than not guessing.

So: no lists, no headings, no code blocks. Indentation is preserved as characters but collapses in the browser, which means ASCII tables and indented code come out as run-together prose. If your text is really Markdown, use the Markdown page — those conventions mean something there.

One thing you don't have to worry about

Angle brackets, ampersands and quotes are escaped, every one of them. Text containing <b>bold</b> shows those characters on the page instead of turning bold.

That's the definition of the tool rather than a safety feature bolted on. Plain text is plain text: if it could contain markup, it wouldn't be.

Paste the text or drop a .txt file, pick how single newlines should behave, and copy the HTML out. It all runs in your browser.

Text → HTML