gizmobench
BrowseDaily

Convert Newlines to HTML BR Tags

This page opens Line breaks: each source newline becomes a br tag between lines, without p wrappers. Use it for an address, short poem or other text whose line divisions matter. Paste text or open a local UTF-8 TXT file, then copy the fragment or download the standalone HTML page. Empty lines inside the text remain additional breaks; blank lines at the beginning and end are removed. It does not preserve runs of spaces or tabs as a pre element would.

Mode
Lines
4
Links
off
Line breaks
br

Lines are separated by br tags and no p element is added. Auto-linking is off, so a web address stays as the text you typed.

  • Angle brackets in the texta tag typed as text
    <p>Read the &lt;script&gt; note first.</p>
  • A blank linetwo blocks
    <p>One paragraph.</p> <p>And a second one.</p>
  • A javascript: URLauto-link on
    <p>Open javascript:alert(1) or <a href="https://example.com">https://example.com</a></p>

The html pane is a preview of the markup, printed as characters: this page never renders what you paste, so a tag in your text cannot do anything here. The only tags this tool writes are <p>, <br>, <ul>, <ol>, <li> and <a href="...">, with no class, no style and no other attribute, so the markup takes the styling of the page you paste it into. Everything else that arrives is your text, escaped. Copy takes the fragment shown in the pane; Download HTML wraps it in a standalone page with a UTF-8 declaration. Local files must be UTF-8 plain text; Word, PDF and rich-text document layouts are not imported. There is no fixed input-size limit; the practical limit is this browser’s memory.

Accuracy. Every character is escaped before any markup is added, so nothing you paste can become a tag or an attribute. Auto-linking is off until you switch it on and then only ever builds http, https and mailto links. The conversion and the preview both run in your browser.

Common questions

Does each line get a closing br tag?
br is a void element with no closing tag. A br is inserted between source lines; there is no extra br after the last line. CRLF and CR source endings are normalized to LF before conversion.
Should I use br tags for paragraphs?
Use the parent’s Paragraphs mode for prose with paragraph boundaries. Line breaks expresses divisions within one text run. It adds no p wrappers, heading elements or CSS.
Does opening this page replace my remembered settings?
The preset opens Line breaks while retaining your remembered auto-link and paragraph-break choices. Selecting a mode, including the already selected mode, saves that mode; untouched preset keys retain their earlier remembered values.

Every character is escaped before any markup is added, so nothing you paste can become a tag or an attribute. Auto-linking is off until you switch it on and then only ever builds http, https and mailto links. The conversion and the preview both run in your browser.