July 15, 2026

Null and void... or secret drama?

Nul Characters in Strings in SQLite

SQLite’s invisible text twist has coders joking, arguing, and side-eyeing their own data

TLDR: SQLite can store hidden text after an invisible character, and some tools stop showing anything after that point, which can seriously mislead users. Commenters split between “this is normal, calm down” and “wow, that’s a great way to hide weird data and confuse everyone.”

A tiny hidden character has turned a boring database note into full-on comment-section theater. The big reveal: SQLite, a wildly popular tool apps use to store data, can keep a secret zero-value character inside text. To regular humans, that means a word can look like it ends at “abc,” while the database is quietly hiding “xyz” behind the curtain. Even wilder, some built-in tools only show the part before that hidden character, which sent readers straight into “that looks like a bug!” territory.

And oh, the reactions. One camp basically shrugged and said, this is just old-school C string behavior, so stop acting surprised. Another camp was very much not chill, pointing out that if your tools pretend part of the text doesn’t exist, confusion is guaranteed. Then came the chaos agents: jokes about bringing back the ancient DEL key to “rub out the previous character,” and darkly amused observations that this quirk could be used to hide data in plain sight from everyday database viewers. Not secure, commenters stressed, just sneaky enough to make people uncomfortable.

There was even a nerdy appreciation post for UTF-8, the text format that avoids this mess better than older fixed-width styles. So the mood was a perfect internet cocktail: half practical explanation, half mock horror, with a garnish of comedy. The real scandal wasn’t just the hidden character — it was how many people suddenly wondered what else their tools aren’t showing them.

Key Points

  • SQLite allows embedded NUL characters inside text strings stored in the database.
  • In SQLite, `length()`, `quote()`, and CLI output such as `.dump` stop at the first NUL character, which can hide the remainder of the stored string.
  • A text value like `'abc'||char(0)||'xyz'` is stored as a 7-character string even if CLI output makes it appear as `abc`.
  • Comparing that stored value to the 3-character string `'abc'` returns no rows because SQLite treats them as different values.
  • The article describes using `CAST(... AS BLOB)` and a detection expression to find embedded NULs, and shows that `UPDATE` statements can remove the NUL and following text.

Hottest takes

"how about making DEL rub out the previous character?" — DonHopkins
"Using this quirk allows for 'hiding' data in the database" — bruce511
"I really don't see why this is a problem. It gives out exactly what you give it." — adzm
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.