Perplexity · web chat
Clean Watermarks From Perplexity Answers
Perplexity is answer-first: it writes a cited answer and the code you want usually sits inside that answer, next to reference markers, source chips and links. That means the code has been through more HTML on its way to your clipboard than the same code coming out of a plain chat interface. This page covers the surfaces Perplexity actually has, the browser answer, the Comet browser, and the API, and what each one can leave in a file.
Scan your Perplexity code now
Free, and it reports every removal by codepoint and line.
What we measured
68
code-generation calls
17
provider and model targets
59,486
characters generated
0
contained a hidden character
On 2026-08-12 we sent identical code-writing prompts to every model our own gateway can reach and scanned each raw API response. Not one of them contained a zero-width character, a bidirectional control, or a tag character.
3 of the 68 answers contained typographic punctuation, and only in the prose-heavy prompts rather than in the plain code one. The most common was the non-breaking hyphen, which is visible but still breaks a copied command. 2 left trailing whitespace.
The useful conclusion is the boring one: raw model output is essentially clean, so when you do find hidden characters in your file, they almost certainly came from the path the text travelled rather than from the model. That is what the section below is about.
Scope: this measured API output from models we can reach directly. It did not measure the Perplexity web app, which is the point being made, since the browser is where the characters get added.
How code gets out of Perplexity, and what each path adds
A drag-select spans the whole rendered answer, so the clipboard receives the prose, the inline reference markers and whatever spacing the layout used to keep those markers attached to the words before them. No-break spaces are the normal HTML way to stop a citation marker wrapping onto its own line, and they come along with the selection as real codepoints. Justified or hyphenated text can also contribute soft hyphens that vanish on screen and stay in the file.
A dedicated code-block copy is the cleaner option because it usually reads the block's own text rather than the surrounding layout, so citation markers stay out. It is still a browser copy, so typographic quotes and dashes that the model wrote as such remain exactly as written, and any no-break space inside the block itself is preserved.
When an assistant reads or writes inside a live web page, the text crosses a page's DOM rather than a clean editor buffer, and a page's DOM is full of legitimate typographic characters. Anything inserted into a form field or copied out of a rendered page carries whatever that page's markup used, which is not under Perplexity's control or yours.
The API returns the answer as a raw string with citations delivered as structured fields rather than baked into inline markup, so the whole HTML round trip disappears. What is left is your own handling: the encoding you write the file with, and any template you interpolate the answer into.
The thing that makes Perplexity different from a plain chat UI is that its output is designed to be read with its sources, so the answer body is denser markup than an ordinary message bubble. Reference markers, hover cards and source chips all need spacing that survives layout, and the characters that provide that spacing are exactly the ones a compiler will reject. If you take code from Perplexity regularly, prefer the code block's own copy button over selecting the answer, and if you are automating anything, take the Sonar API instead and keep the citations as data. This tool reports what it removed by codepoint and line, so you can see whether the answer body or your own pipeline was responsible.
What this does not do
It does not remove statistical watermarking. Schemes of the SynthID family add no characters at all: they bias which token the model samples, so the signal lives in word choice across the whole output and nothing you can delete carries it. Attacking that means rewriting the text, which for source code risks changing what it does.
This is a hygiene and security tool, not an attribution bypass. Formatters already normalise surface signals, and what identifies generated code is structure and style rather than hidden bytes. Disclose AI assistance wherever you are asked to.
Perplexity questions
Why does code copied from a Perplexity answer seem messier than from a plain chat? +
Because there is more markup between the text and your clipboard. An answer is laid out to hold citations next to the words they support, and holding things together in HTML is done with characters such as no-break spaces. Copying the whole answer copies that layer; copying only the code block avoids most of it.
Do the citation numbers count as watermarks? +
No. Bracketed reference markers are ordinary visible digits and punctuation, and this tool will leave them alone because it only removes codepoints that render as nothing. What it will remove is the no-break space that often sits between the word and its marker. Strip the markers yourself, then run the file through here for the ones you cannot see.
Does the Sonar API have the same problem? +
Much less of one. An API response is a raw string and the citations arrive as separate fields, so there is no rendering step to introduce spacing characters. Anything you then find in your file came from your own writing step, and the line numbers in the report usually point straight at it.
Can this tell me whether text was written by Perplexity? +
No, and nothing here should be read that way. The tool removes characters that are present but not visible, and it makes no claim about who or what produced the text. Statistical watermarking in particular adds no characters at all, so no character edit affects it in either direction.