March 3, 2026
Break lines, break minds
You can use newline characters in URLs
Browsers swallow line breaks in links; commenters yell “please don’t”
TLDR: A respected coder shows browsers ignore line breaks in HTML link addresses, and data URLs ignore spaces entirely. Commenters clap back: some call it a dangerous, confusing gimmick tied to HTTP quirks, others say it’s fine inside HTML—cool trick, not a best practice, handle with care.
Software performance guru Daniel Lemire just revealed a weird web fact: you can put line breaks and tabs inside link addresses in HTML, and browsers still follow them. The WHATWG URL spec flags it as an error, then quietly removes the junk—so your messy link works. He also points out that “data URLs” (tiny files embedded directly in a link) ignore all spaces when decoding base64, the text trick that turns binary into readable characters. Translation for non‑nerds: long link? You can make it look neat. Tiny image in a link? Spaces don’t matter.
The comments? Pure popcorn. TZubiri slams the brakes: 100% will not—because newlines are separators in HTTP, the web’s message‑sending system, and that sounds like trouble. Old‑school warrior renewiltord vows no spaces anywhere, chanting “May MyDocu~1 live on,” a throwback to short, no‑nonsense file names. bmandale tries to calm the room: this is about HTML attributes, not the actual address sent over the wire. Then the jokers arrive: pants2 compares it to pouring pickle juice on cereal (technically possible, morally questionable), while bubblewand flexes with “vertical tabs in file names,” because chaos. The vibe: cool party trick, risky habit. One camp fears confused devs and broken links; the other defends readability where it’s safe, especially in data URLs. Standards nerds vs practical tinkers—and everyone’s a little dramatic.
Key Points
- •Browsers follow the WHATWG URL specification, which logs a validation error for ASCII tab/newline in URL input, then removes those characters and continues parsing.
- •URLs in HTML attributes can include newline and tab characters and still work in practice because the parser strips them.
- •Tabs are allowed similarly; arbitrary insertion of other whitespace in general URLs is not permitted.
- •Data URLs with base64-encoded content ignore all ASCII whitespace during decoding, allowing spaces, tabs, and newlines within the payload.
- •Examples show embedding a PNG and an SVG via data URLs, demonstrating readable formatting without breaking functionality; further reading provided via a 2024 paper.