BibTeX Formatter & Validator
Pretty-print, validate, and sort your .bib bibliography — consistent indentation, sorted entries, aligned fields. Runs entirely in your browser, no server, no sign-up.
About this tool
This BibTeX formatter and validator tidies up your .bib bibliography
files. Paste your BibTeX source and it parses every entry, reports any syntax
error (unbalanced braces, a missing =, a truncated entry), then re-emits the
whole file in a clean, consistent style — one field per line, indented, with the
entry type and field names normalized to lowercase.
It runs entirely in your browser. Nothing is uploaded to a server, so even unpublished or sensitive references stay on your machine.
What it does
- Validates the syntax and points at the offending entry when something is wrong.
- Pretty-prints each entry with one field per line and configurable indentation.
- Sorts entries by cite key, or by entry type then key — handy for keeping a large bibliography in a stable, diff-friendly order.
- Sorts fields within each entry alphabetically, if you want a canonical field order.
- Aligns the
=signs so the values line up in a neat column. - Lowercases the entry type (
@ARTICLE→@article) and field names, while leaving your field values untouched —{braces},"quotes", numbers and#-concatenated@stringmacros are all preserved exactly.
Supported entry kinds
Normal entries (@article, @book, @inproceedings, @misc, …) plus
@string abbreviation definitions, @preamble blocks, and explicit
@comment blocks. Free text between entries is dropped, matching standard
BibTeX behaviour.
Tips
- Use Sort entries → by key to keep your bibliography in a predictable order so version-control diffs stay small.
- Turn on Align the = signs for the most readable hand-edited
.bibfiles. - Set the indent to 0 for a compact one-level layout, or up to 16 spaces for deeply indented output.
FAQ
Will formatting change the text inside my field values?
No. Field values are preserved byte-for-byte — protective {braces},
"quoted" values, bare numbers and #-concatenated @string macros all come
through unchanged. Only the entry type (@ARTICLE → @article, unless you
turn "Lowercase the @entry type" off) and the field names are normalized to
lowercase.
Where do @string, @preamble and @comment blocks go when I sort?
They stay at the front of the file, keeping their original relative order.
Sorting (key or type-key) only reorders the normal entries among
themselves, so abbreviations defined in @string are still declared before the
entries that use them.
Why am I getting a "duplicate cite key" error?
Duplicate-key checking is on by default because two entries with the same key silently shadow each other in LaTeX. The error names the repeated key so you can rename one of them; if the duplicates are intentional, untick "Error on duplicate cite keys" and the file will format anyway.
Why did loose text between my entries disappear?
BibTeX itself treats anything outside an @entry{...} as an implicit comment,
so the formatter drops free text between entries to produce a canonical file.
If you need a comment to survive formatting, wrap it in an explicit
@comment{...} block — those are kept.
Developer & Automation Access
Run it from the terminal
Same engine as this page, headless — via the gizza CLI:
gizza tool bibtex-format "@article{einstein1905, title={Zur Elektrodynamik bewegter Körper}, author={Einstein, Albert}, year=1905}"New to the CLI? Get gizza →
Open it by URL
Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:
https://gizza.ai/tools/bibtex-format/?bibtex=%40article%7Beinstein1905%2C%20title%3D%7BZur%20Elektrodynamik%20bewegter%20K%C3%B6rper%7D%2C%20author%3D%7BEinstein%2C%20Albert%7D%2C%20year%3D1905%7D&sort=none&sort_fields=true&indent=2&align_values=true&lowercase_type=true&check_duplicates=trueMachine-readable descriptor: tool.json — title + parameters JSON Schema for agents.
