Using `<br>` for Line Breaks in Markdown — When It Works, When It Doesn't

When HTML `<br>` works in Markdown (GFM table cells, addresses), when sanitizers strip it, and when to prefer trailing-space or backslash hard breaks instead.

What you'll learn

In Markdown, blank lines separate paragraphs, and hard breaks (two trailing spaces or a backslash at end of line) handle line breaks inside a paragraph. Even so, there are times when you want an HTML <br>—for example, inside a GFM table cell when you need two lines of text, or for addresses, short poetry, or stacked lines where you do not want a full new paragraph. Because <br> is real HTML, tools and sites may strip it during sanitization, so the break can "vanish" depending on environment.


When <br> is a good fit

In tables (GFM and similar), <br> is a common way to split explanatory text across two lines in one cell. It also helps when you want to keep one paragraph semantically but break lines visually. On the other hand, long prose chained with <br> can be hard to read on small screens or with screen readers—prefer blank-line paragraph breaks for long text.

Good uses of <br>:


Sanitization and "it doesn't work"

Many web apps restrict HTML for XSS protection. If <br> is not on the allowlist, it is removed at render time and the break is lost. You might see it in a local editor but not in production—this is why. If you own the pipeline, configure DOMPurify (or similar) to explicitly allow br where appropriate.

What to check:


Alternative syntax

MethodSyntaxBest for
Blank linetext\n\ntextNew paragraph
Two trailing spacestext + newlineIn-paragraph break (if editor keeps trailing spaces)
Backslashtext\ + newlineIn-paragraph break (most editor-safe)
<br>text<br>textTable cells, addresses—in HTML-allowed environments

CommonMark hard breaks: two spaces at end of line then newline, or a backslash at end of line then newline. These stay in "plain" Markdown and do not depend on raw HTML being allowed. Note: some editors trim trailing spaces on save—then the backslash form can be safer. A blank line starts a new paragraph and makes semantic breaks clearer. Treat <br> as a narrow tool: "same paragraph, new line only."


Accessibility

Do not stack many <br> tags just to add vertical space—that tends to be noise for assistive tech. Meaningful separation is usually better as paragraphs or lists.


Renderer and editor differences

GFM, CommonMark parsers, and note apps handle HTML differently. If <br> works in preview but disappears in CI-built HTML, check parser options (whether raw HTML is allowed, whether output is sanitized). The same .md can diverge between local preview and build.


Outside table cells

Relying on <br> in body copy makes it harder to unify line height and paragraph margins with CSS later. If your design system expects spacing via margin on paragraphs, blank lines + paragraphs usually style more predictably than <br>. Reserve <br> for short inline stacks.


Operations and review

When teams argue "br vs blank line," anchor on meaning: use a blank line when you want a new paragraph; use hard breaks or <br> only for short same-paragraph line splits. In static site generators or CMSes, if raw HTML is disabled, <br> may be escaped and shown as text—verify build settings too.


FAQ

<br> disappeared in my table cell

The CMS or portal sanitizer likely strips it. Check the platform's allowed HTML tags list; if <br> is absent, switch to a different approach or configure the pipeline to permit it.

<br> or two trailing spaces—which is more reliable?

It depends. <br> needs HTML permission; trailing spaces can be deleted by editors. The most reliable portable option is the backslash \ CommonMark hard break.

Multiple <br> tags create too much space

Use CSS margin or padding for spacing—not repeated <br> tags. Stacked breaks are also bad for accessibility.

<br> looks wrong in PDF output

In PDF (print pipeline), <br> rendering interacts with line-height and margin. Check the preview and tweak layout settings accordingly.


Summary

<br> is handy, but check HTML policy and document structure. Prefer trailing spaces, backslash breaks, or blank lines when you can. When unsure, ask: "Do I mean a new paragraph, or only a new line?"

ToolMarkdown to HTML (md to html)Preview .md in the browser, adjust layout, and download HTML.Open tool