Line breaks to <br> converter
HTML ignores plain line breaks. This adds <br> so addresses, poems and signatures keep their lines.
Loading the tool…
Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.
How to use it
- Enter text, tag style, keep the newline after each tag and escape special characters (& < >).
- The result appears straight away and updates as you edit.
- Copy the result, or copy a link that keeps the same values to share it.
How it is calculated
Put <br> (or <br /> in XHTML style) at every line break, optionally keeping the newline after it for readability and optionally escaping &, < and >.
Example
Inputs: Tag style = <br> (HTML5), Keep the newline after each tag = yes, Escape special characters (& < >) = no. Result: Result: King Fahd Road<br> Riyadh 12211<br> Saudi Arabia; br tags added: 2.
King Fahd Road Riyadh 12211 Saudi Arabia
King Fahd Road<br> Riyadh 12211<br> Saudi Arabia
Limits and caveats
- Blank lines become extra <br> tags; for real paragraphs use the text to HTML paragraphs tool.
Questions about this tool
Why do lines not show in HTML without br?
Browsers treat a line break as an ordinary space, so an explicit tag is needed to break the line.
Should I use <br> or <br />?
Both are valid in HTML5. <br /> is only required for XHTML or some older email templates.
Are special characters escaped?
Not by default, matching nl2br. Turn escaping on if the text is plain and may contain < or &.
