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
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 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.
Paste your .bib
Paste entries exported from Google Scholar, Zotero or Mendeley into step 1, or press Load example.
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.
Read the result
The sanitized .bib in step 2 updates as you type, with a count of the entries cleaned and the fields removed.
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.
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?
Why did some words in my titles gain braces?
Can it handle nested braces in a value?
What is the point of the en-dash fix?
Which fields should I strip?
Runs entirely in your browser, no data leaves your device.