Skip to content

Free tool

BibTeX Formatter

Paste a .bib file and get it back tidy and safer to compile. The formatter lines up the fields, escapes & and %, fixes page ranges and removes export clutter. It also lists duplicate keys and entries with missing fields. No account needed.

The file stays in your browser.

2. Choose what to change

3. Copy the cleaned file

@article{Smith2020,
  author  = {Smith, Jane and M{\"u}ller, Hans},
  title   = {Heat \& mass transfer in 100\% humid air},
  journal = {Journal of Applied Physics},
  pages   = {12--34},
  year    = 2020,
}

@inproceedings{Smith2020,
  author = {Smith, Jane},
  title  = {A second entry with the same key},
  year   = {2021},
}

2 entries, 3 fields removed.

Check these before you compile:

  • Smith2020: @inproceedings has no booktitle.
  • The key "smith2020" is used 2 times. BibTeX stops with "Repeated entry".

Compile it

Compile the bibliography

LaTeX Cloud Studio opens a starter article with a bibliography in the browser. Replace its .bib file with yours and compile; BibTeX runs for you.

What a clean entry looks like

An entry starts with its type and a citation key, then lists fields as name = {value}, each followed by a comma. Values in braces are safest: quotes work too, but braces nest. Numbers and month macros such as may can stand without braces, and the formatter keeps them that way so their meaning does not change.

@string and @preamble blocks and comments are kept as written and stay where they are. When you sort the entries, they move to the top, so that every string is still defined before the entries that use it, and a parent entry named in a crossref stays after its children, as BibTeX requires.

Errors the formatter helps you find

  • Repeated entry: a citation key is used twice.
  • Misplaced alignment tab character &: an & in a title or journal name. The formatter writes \&.
  • I was expecting a `,' or a `}': a missing comma or an unbalanced brace. Entries that cannot be read are listed with their line and left out of the result, so fix them in the input.
  • Warning: empty journal, booktitle or year: a required field is missing. The formatter lists these per entry.

More on bibliographies

Questions

What does the formatter change in my .bib file?

It writes entry types and field names in lower case, puts one field per line with the = signs lined up, orders the fields, writes page ranges as 12--34, escapes & % and # in text fields, and removes empty fields and the fields you list (abstract and file by default). Your citation keys stay the same unless you tick the rename option.

Why does BibTeX say "Repeated entry"?

Two entries have the same citation key, which often happens after merging exports from two reference managers. BibTeX keeps the first and reports an error. The formatter lists every key that is used more than once, and entries that share a DOI or a title.

Do I have to escape & and % in a .bib file?

Yes, in fields that are printed as text, such as title, journal and publisher. An unescaped & stops LaTeX with "Misplaced alignment tab character &", and a % hides the rest of the line. Write \& and \%. The url and doi fields are different: they are copied verbatim, so the formatter leaves them alone.

Why remove the abstract and file fields?

Reference managers such as Zotero, Mendeley and JabRef export them, but a bibliography never prints them. Abstracts often contain % signs and unbalanced braces that break the build, and file fields contain paths from your own computer. Clear the "Remove these fields" box to keep them.

Will renaming keys break my document?

Yes, until you update it: every \cite must use the new key. Renaming is off by default. Use it for a new project, or when the keys in an exported file are unreadable.

Is my bibliography uploaded?

No. The file is read and formatted in your browser. Nothing is sent to a server, and you do not need an account.