Convert plain-text line breaks into HTML <br> tags (nl2br), with an optional XHTML self-closing mode and a reverse br-to-newline mode. Newline to BR Converter is a free online tool from the ToolsRift HTML Tools collection. It runs entirely in your browser — nothing to install, no signup, and your data never leaves your device.
It replaces every newline character (\n, \r or \r\n) in your text with an HTML <br> tag so line breaks survive when the text is rendered inside HTML, mirroring PHP's nl2br() function.
XHTML and self-closing HTML require void elements to be closed, so XHTML mode outputs <br /> with a trailing slash instead of <br>. Standard HTML5 accepts either form.
Yes, switch to reverse mode to turn <br>, <br/> and <br /> tags back into plain newline characters, which is handy when cleaning HTML into editable plain text.