BibTeX Formatter

Pretty-print and normalise a .bib file.

Open tool

Overview

The BibTeX formatter cleans up messy .bib files by parsing every entry, normalising indentation, sorting fields, and re-emitting a consistent block per reference. It is the fastest way to make a hand-written bibliography file readable before you commit it to a thesis repository or hand it off to a co-author.

Researchers, graduate students, and journal editors reach for this when working with citations exported from Google Scholar, Zotero, or arXiv — sources that often mix quoting styles, leave trailing commas, and bury long abstract fields on a single line. Long-tail searches that lead here include "format BibTeX file online", "clean up .bib file indentation", and "pretty-print bibliography references".

How it works

A BibTeX entry is a record beginning with @type{citekey, field = value, ...}. Field values may be wrapped in braces {}, double quotes "", or appear bare for numeric values. The formatter tokenises each entry, preserving the citation key untouched (case sensitivity matters for \cite{} lookups), then re-emits fields one per line with aligned = signs and trailing commas.

Comments outside entries and @string / @preamble blocks are passed through verbatim. Unicode characters in titles or author names are left intact rather than escaped into LaTeX macros, since modern engines like XeLaTeX and LuaLaTeX handle them natively.

Examples

  • Collapse a one-line @article{...} exported from Scholar into a multi-line block with author, title, journal, year, and DOI each on its own line.
  • Normalise mixed "…" and {…} value delimiters across a 200-entry library to the brace form preferred by most style files.
  • Sort fields into a canonical order (author, title, journal, year, volume, pages, doi) for predictable diffs in version control.
  • Re-indent a @book entry whose editor field was wrapped across three ragged lines.

FAQ

Will it change my citation keys?
No. Keys are preserved exactly, including case. Renaming a key would silently break every \cite{} reference in your manuscript.

Does it validate the BibTeX syntax?
The parser will flag entries with unbalanced braces or missing required commas, but it does not enforce that, for example, @article entries must include a journal field — that is the style file's job.

What about LaTeX accent macros like \'{e}?
They are kept as-is. The formatter does not normalise between \'{e} and the literal é; pick a convention in your source library and stick with it.

Are duplicate entries removed?
No. Two entries with the same citation key will both survive a format pass; deduplication is left to a bibliography manager.

Does it support @string abbreviations?
Yes. @string definitions are emitted before the first entry that references them, and inline references like journal = ieee_tpami are left unexpanded.

Try BibTeX Formatter

An unhandled error has occurred. Reload ×