Skip to content

BibTeX Sanitizer

Clean up BibTeX exported from Google Scholar, Zotero or Mendeley: strip bulky fields, fix page ranges, line up the equals signs and brace the acronyms in titles.

Step 1: Paste your .bib

Rules

Fields to remove

Step 2: Sanitized .bib

The cleaned entries will appear here

Paste BibTeX in step 1. With the rules as set, each entry comes back without url, abstract and the other ticked fields, with page ranges as 100--110 and acronyms in its title braced.

How-to guide

How to clean and standardize a .bib file

Reference managers export citations with tracking URLs, giant abstracts and inconsistent formatting. Here is how to sanitize them for a tidy LaTeX bibliography.

1

Paste your .bib

Paste entries exported from Google Scholar, Zotero or Mendeley into step 1, or press Load example.

2

Check the rules

Open Rules to choose which fixes run and which fields are removed. By default url, urldate, abstract, keywords, file and eprint go.

3

Read the result

The sanitized .bib in step 2 updates as you type, with a count of the entries cleaned and the fields removed.

4

Copy or download

Copy puts the result on the clipboard; Download saves it as sanitized.bib.

How the sanitizer works

What each rule does

Fix page ranges turns 100-110 into the LaTeX en-dash 100--110 and leaves ranges that are already right alone. Line up the equals signs pads field names so the = signs line up; it changes nothing LaTeX reads. Remove these fields drops bulky fields that are not typeset, such as abstract, url and file.

Brace-aware parsing

The parser tracks brace depth, so a value like title = {A study of {NaCl}} is read correctly instead of being cut off at the first inner brace. @string, @preamble and @comment blocks pass through untouched, and every value keeps the form it was written in: month = jul and journal = jcp stay bare, so the macros still apply. Everything runs locally in your browser.

A note on “Protect capitals in titles”. Many bibliography styles lower-case titles, which turns DNA into “dna”. This rule braces only the words whose case matters: runs of capitals ({DNA}, {NMR}), words with a capital inside them ({NaCl}, {McMurry}) and a lower-case letter followed by capitals ({pH}, {mRNA}). A command with a capital in its name is braced together with its arguments ({\LaTeX}, {\SI{5}{\nano\metre}}), and a formula with a capital in it is braced whole ({$T$}), so both still compile after the style has lower-cased the title. The rest of the title is left for the style to case, as most editors prefer, and anything already in braces is left alone, so running it twice changes nothing. A proper noun with a single capital, such as Einstein, is not caught: brace it yourself. See the TeX FAQ link below.

Frequently asked questions

Does the sanitizer upload my references?
No. All parsing and formatting happen in your browser. Nothing is sent anywhere.
Why did some words in my titles gain braces?
The ‘Protect capitals in titles’ rule braces acronyms, chemical formulae and words such as pH and mRNA, so a style that lower-cases titles leaves them as they are. Turn it off if you would rather brace words yourself.
Can it handle nested braces in a value?
Yes. The parser is brace-aware, so nested groups such as {A study of {NaCl}} are preserved rather than truncated.
What is the point of the en-dash fix?
In LaTeX, page ranges use an en-dash, written as two hyphens (100--110). The rule converts single hyphens between page numbers and is safe to run repeatedly.
Which fields should I strip?
Fields that do not affect typesetting (such as abstract, url, urldate, file and keywords) are common culprits for bloated .bib files. Keep anything your citation style actually prints.

Runs entirely in your browser, no data leaves your device.