# How to validate (check) a biblatex .bib file?

How can I validate the correctness a biblatex .bib file?

Where validate means checking for:

• Duplicate keys
• Missing mandatory fields

What tools do you use?

To validate my .bib files, I put together a Python script called Biblatex Checker.

It checks for missing fields, provides suggestions for common mistakes when using biblatex and identifies duplicate IDs.

It's based on BibTeX Check by Fabian Beck, which can be used for BibTeX files.

• I've love to hear what other LaTex users are using though! – Pez Cuckow Apr 26 '14 at 16:40
• I use biber --tool -V bib.bib. It doesn't complain about missing fields but I didn't try yet to find out how to change it (or in case in can't do it yet to make a feature request). – Ulrike Fischer Apr 26 '14 at 18:52
• Actually, -V in tool mode didn't do anything in 1.8. It does in 1.9 dev version. For example it will report on mandatory fields missing from the default data model (in the tool mode config file). You can add any datamodel constraint you want to the data model (either by biblatex macros or via the biber config file for tool mode). The blx-dm.def file that comes with biblatex contains the default data model and its mandatory field constraints. – PLK Apr 26 '14 at 22:42
• @PLK: I get additional output with -V. E.g. warnings like Field 'timestamp' invalid in data model. On the other side: I get much less output with biber 2.0. And it doesn't write a xx_bibertool.bib. – Ulrike Fischer Apr 27 '14 at 14:19
• I only fixed the 2.0 branch yesterday so you should download it again from SF and try it ... I have created an Enhancement issue on the biber github tracker for such things (like the biblatex one but for biber 2.0). – PLK Apr 27 '14 at 14:29

I use jabref. Install jabref, set it to biblatex mode. To do this go to OptionsPreferences. In the window that opens, selectAdvanced and check BibLaTeX mode as shown below.

Then open your .bib file using jabref. Select the entries to be cleaned up. Under Tools menu, select cleanup entries. This window opens:

Now you know what to do :)

For duplicate keys, simply go to ToolsAutogenerate BibTeX keys. It will rewrite the duplicate key with some other name.

• So easy it was! So, one needs to maintain different versions of references? one for BibTeX and another one for BibLaTeX? – Nikos Alexandris Oct 9 '15 at 6:14
• @NikosAlexandris: For those who want perfection, it is the way. But for general needs bibtex is enough. The bibtex file serves for biblatex too if one is willing to live with some warnings etc. – user11232 Oct 9 '15 at 7:44
• I have an error now using BibLaTeX and XeLaTeX which was not there when using BibTeX and PDFLaTeX. Need to understand what is wrong and correct it. Two of my citations are printed with some long dash instead of the corresponsing author's name. – Nikos Alexandris Oct 9 '15 at 8:10
• @NikosAlexandris Some where you are using abbrv style. – user11232 Oct 9 '15 at 8:19
• The .log has the following entry: \c@abbrvpenalty=\count217. I'll try to find the "error". – Nikos Alexandris Oct 9 '15 at 8:22
\documentclass{article}
\begin{document}
\nocite{*}
\bibliographystyle{plain}
\bibliography{mybib}
\end{document}


Run latex and bibtex and then look into the logfile of the bibtex run (<filename>.blg). It has all warnings.

• I get no warnings for duplicate entries... – PatrickT Jun 22 '18 at 15:30

https://biblatex-linter.herokuapp.com/ provides an online Bibtex linter.

It's an Heroku app (Python/Django). It's open source and MIT licensed. https://github.com/Pezmc/BibLaTeX-Linter.

It's based on https://github.com/Pezmc/BibLaTeX-Check

Run biber --tool --validate-datamodel <filename>.bib

• Note that the exact data model is style dependent, so usually the most complete and relevant report that you can get is the one issued by biber --validate-datamodel <texfilebasename> where <texfilebasename> is the basename of the .tex document you are writing at the moment. – moewe Oct 30 '18 at 10:33
• I was assuming that one is given just a .bib file. Users of custom data models probably already know that biber can replace 3rd party tools. – pavel Oct 31 '18 at 11:14
• Mhhh, I'm not so sure if people would realise that. Anyhow, at least for me biber --tool did not catch the four obvious errors in @article{sugfridsson, editor = {Sigfridsson, Emma and Ryde, Ulf}, title = {Title}, blournal = {Journal}, } that --validate-datamodel reported. So at least for the mandatory field validation --tool mode alone is not enough. I guess what I'm saying is that your answer would be better if you suggested biber --validate-datamodel --tool <filename>.bib – moewe Oct 31 '18 at 11:29