BibTeX Cleaner & Validator
Paste a .bib file — or load it — and get it back checked and tidy: missing required fields, duplicate keys, repeated DOIs and undefined macros flagged with line numbers; page ranges, months, braces and field order made consistent; and every change listed, so you can see exactly what was done. Free, no sign-up, and the file never leaves your browser.
Clean-up options
Paste a .bib file or load one. It is read in your browser — nothing is uploaded.
How to Use the BibTeX Cleaner
- 1. Paste or load your .bib file. The reader takes the whole file as BibTeX itself reads it:
@stringmacros,#concatenation,@preamble,@comment, nested braces and notes between entries. - 2. Choose the clean-up. Every option is on by default except capital protection and sorting; switch off anything you want left alone. The result updates as you change options.
- 3. Read the problems. Errors and warnings are listed with their line and citation key, from a missing journal to a key used twice.
- 4. Check the changes, then download. Every change is logged by entry and field, with the value before and after; the result downloads as
cleaned.bib.
What the Validator Checks
Classic BibTeX defines fourteen entry types and the fields each one requires. The validator applies that table, from Oren Patashnik's BibTeXing — the documentation that ships with BibTeX — and accepts biblatex's names for the same data, so journaltitle, date and a thesis's institution count as their classic equivalents.
| Entry type | Required fields |
|---|---|
@article | author, title, journal, year |
@book | author or editor, title, publisher, year |
@inbook | author or editor, title, chapter or pages, publisher, year |
@incollection | author, title, booktitle, publisher, year |
@inproceedings | author, title, booktitle, year |
@phdthesis, @mastersthesis | author, title, school, year |
@techreport | author, title, institution, year |
@misc | none |
@booklet and @manual need only a title, @proceedings a title and year, and @unpublished an author, title and note; @conference is another name for @inproceedings.
It also flags a key used twice (BibTeX keeps only the first entry), keys that differ only in capitals, keys containing a space or another character BibTeX cannot read, the same DOI in two entries, the same title and year in two entries, a field given twice, a macro used but never defined with @string, and a year that is not four digits. An entry the reader cannot finish — a missing comma, an unbalanced brace — is reported with its line number and kept exactly as written, so cleaning never deletes text.
What the Clean-Up Changes
- Entry types and field names in lower case:
@ARTICLEbecomes@article,Authorbecomesauthor. - Whitespace: line breaks and runs of spaces inside a value collapse to single spaces.
- Delimiters: quoted values move into braces, which survive a stray quotation mark in a title.
- Page ranges with the double hyphen that LaTeX prints as an en dash: 16569-16572 becomes 16569--16572.
- Months as BibTeX's macros,
jantodec, written without braces so every style can print or abbreviate them. - Empty fields such as
note = {}are removed. - DOIs lose a https://doi.org/ prefix; styles that print the DOI add their own.
- Capitals in titles (optional): braces around acronyms and mixed-case words —
{DNA},{mRNA},{iPhone}— or around every capitalised word after the first, so styles that set titles in sentence case cannot lower-case them. - Field order: author, title, journal or book title, volume, number, pages, year, month, publisher, then identifiers; or alphabetical; or left as it was.
- Sorting (optional): by key, first author or year.
@stringdefinitions stay at the top, because a macro has to be defined before an entry uses it.
One entry before and after
Pasted
@ARTICLE{hirsch2005,
Author = {Hirsch, J. E.},
title = "An index to quantify an individual's scientific research output",
journal = {Proceedings of the National Academy of Sciences},
year = 2005, month = {November},
pages = {16569-16572},
note = {}
}Cleaned
@article{hirsch2005,
author = {Hirsch, J. E.},
title = {An index to quantify an individual's scientific research output},
journal = {Proceedings of the National Academy of Sciences},
pages = {16569--16572},
year = 2005,
month = nov
}The change log for that entry has seven lines: the type lower-cased, Author renamed author, the title moved into braces, November turned into the macro nov, the page range given its double hyphen, the empty note removed and the fields put in order. The year stays a bare number, which BibTeX accepts.
BibTeX or biblatex?
The same .bib file can feed two systems. Classic BibTeX, with styles such as plain or a journal's own .bst file, knows the fourteen standard types and silently ignores fields it does not recognise. biblatex, processed by biber, adds types such as @online, @report and @thesis, fields such as journaltitle, date, location, urldate and eprint, and reads accented letters directly instead of needing LaTeX accent commands. The validator warns when an entry uses a biblatex-only type — a classic style falls back to @misc with a warning — but never reports a biblatex field name as a missing field.
Frequently Asked Questions
- How do I check a BibTeX file for errors?
- Paste it into the box above or load the .bib file. The validator lists every problem with its line number and citation key: entries that cannot be read, missing required fields, duplicate keys, repeated DOIs or titles, undefined macros and years that are not four digits. Fix the errors first; they are the ones that make BibTeX warn or drop a reference.
- What does “I'm skipping whatever remains of this entry” mean?
- It is BibTeX giving up on an entry it cannot parse — usually because of a missing comma between two fields, an unbalanced brace or a quotation mark inside a quoted value. The cleaner reports the same entries as parse errors with their line numbers and keeps them in the output exactly as written, so you can repair them in place.
- Should page ranges use -- in BibTeX?
- Yes. BibTeX passes the pages field to LaTeX, where -- prints an en dash, the correct mark for a range. Many standard styles turn a single hyphen into -- themselves, but not every style does, so writing -- in the file is the safe choice — and the cleaner does it for you.
- Why does BibTeX lower-case my title, and how do I stop it?
- Many styles print article titles in sentence case and lower-case every letter that is not protected by braces, so DNA becomes dna. Wrapping a word in braces — {DNA} — protects it. The cleaner's capitals option adds those braces to acronyms and mixed-case words, or to every capitalised word after the first when your titles are full of proper nouns.
- Are duplicate citation keys a problem?
- Yes. BibTeX uses the first entry with a key and ignores the rest, so a citation can silently point at the wrong work. Keys that differ only in capitals are flagged too: BibTeX warns about them and biber treats them as two keys, so the same citation can behave differently with each.
- Is my .bib file uploaded?
- No. The file is read and cleaned entirely in your browser; nothing is sent to a server, and the cleaned copy is created on your own device when you download it.