A .bib file is a plain-text database of bibliographic information. You write each work as an entry — a type (such as @article) and a set of fields (author, title, …) that record the raw data, never the appearance. Where the BibTeX page covers *how to run the tools*, this page details the .bib file itself: the entry types, how fields are written, and what order the reference list comes out in.
The great payoff of a .bib file is reuse. Write it once and carefully, and you can share it across papers; when the venue changes you touch only the style, never the data. The build sequence (latex → bibtex → latex → latex) and how to pick a .bst style are covered on the [BibTeX page](/learn/bibliography/bibtex-page), so they are left out here.
The shape of an entry
A single entry begins with @ and a type, then in braces gives a citation key followed by its fields. The skeleton looks like this:
@article{shannon1948,
author = {Shannon, Claude E.},
title = {A Mathematical Theory of Communication},
journal = {Bell System Technical Journal},
volume = {27},
number = {3},
pages = {379--423},
year = {1948}
}The shannon1948 right after the opening brace is the citation key — an identifier you choose that must match \cite{shannon1948} in the document exactly (people often use surname+year, but anything goes as long as it is unique within the file). After it come fieldname = {value} pairs separated by commas; a trailing comma after the last field is optional. Values are wrapped in braces { } or double quotes " ", and a purely numeric value such as year = 1948 may be left unwrapped. Type and field names are case-insensitive (@Article and @article are the same).
Entry types
The type says what a work is — a journal article, a book, a talk in proceedings — and choosing it tells the style which fields to set and in what order. The table below lists the standard types available under classic BibTeX. Each type has required fields (a warning appears if one is missing) and optional fields, and that mapping is fixed by the style (.bst).
| Type | What it is for | Key required fields |
|---|---|---|
@article | A paper in a journal or periodical | author, title, journal, year |
@book | A book with a named publisher | author or editor, title, publisher, year |
@inproceedings | A paper in conference proceedings | author, title, booktitle, year |
@conference | Alias for @inproceedings (Scribe compat.) | (same as @inproceedings) |
@incollection | A titled chapter in an edited collection | author, title, booktitle, publisher, year |
@inbook | A part of a book (a chapter or page range) | author/editor, title, chapter or pages, publisher, year |
@phdthesis | A doctoral dissertation | author, title, school, year |
@mastersthesis | A master’s thesis | author, title, school, year |
@techreport | A report from an institution | author, title, institution, year |
@manual | A technical or software manual | title (at minimum) |
@unpublished | An unpublished manuscript or draft | author, title, note |
@misc | Anything that fits nowhere above | none required (fill in with note, etc.) |
Two pairs trip people up. **@inbook vs @incollection: the former is *a part of one book* (say, chapter 3 of your own book); the latter is *a self-contained, separately-authored piece inside an editor’s collection*. @inproceedings vs @conference** are functionally identical — @conference is just an older Scribe-compatible alias. For theses, pick @phdthesis or @mastersthesis by the degree. When nothing fits, use @misc and fill in howpublished or note.
Modern biblatex subsumes nearly all of these and adds more: **@online** (alias @electronic) for web resources, a generic **@report** (its type field saying e.g. “technical report”), and a degree-agnostic **@thesis** (likewise carrying the kind in type). @online suits arXiv and preprint records, paired with the eprint fields described below. Note that these newer types assume biber/biblatex; classic bibtex + .bst may not understand them.
Writing the fields
Fields are name = {value} pairs recording a work’s attributes. The ones you meet most often, across all types, are:
author/editor** — the author or editor; multi-author syntax is detailed in the next section.title** — the title: a paper name, book title, chapter heading, etc.journal/booktitle** — the journal name (@article), or the containing book / proceedings title (@inproceedings,@incollection).year/date** — the year of publication. Classic BibTeX usesyear(plus optionalmonth); biblatex prefers an ISO form likedate = {2026-05-01}(a bare yeardate = {2026}is fine too).volume/number** — volume / issue.pages = {379--423}uses a double hyphen for the range (it prints as an en dash “–”).publisher/institution/school** — the publisher / the issuing institution (reports) / the degree-granting university (theses).doi/url** — the DOI (just the10.…body) and a URL; the style renders them as links.eprint/eprinttype/eprintclass** — biblatex’s preprint fields. For arXiv:eprint = {2405.00001},eprinttype = {arxiv}(formerlyarchivePrefix), andeprintclass(formerlyprimaryClass) for the subject.note/howpublished** — free-form remarks / “how it was published” (where a@miscentry’s URL often goes).
Which fields are required vs optional varies by type, and the style is what decides. Omit a required one and BibTeX warns you; an unknown field is (in most styles) silently ignored — so extra fields carried in from imported metadata do no harm.
Author names and brace protection
author is the field most often gotten wrong. Separate multiple authors with **and** (not commas). Each name may be written two ways: natural order First Last (Claude E. Shannon), or surname-first Last, First (Shannon, Claude E.). The surname-first form is safest when a surname is several words or carries a prefix like “von / van der”: writing van der Plas, Geert makes clear that “van der” belongs to the surname (in natural order you instead brace it as a unit, Geert {Van der Plas}).
@book{example2026,
author = {Knuth, Donald E. and Lamport, Leslie},
editor = {{The TeX Users Group}},
title = {On the {NASA} Mission to {TeX}},
publisher = {Addison-Wesley},
year = {2026}
}When there are too many authors to list, end with **and others** — the style turns it into “et al.” And when the author is an organization (The TeX Users Group), the convention is to wrap it in **double braces {{...}}** so that any and inside is not mistaken for a name separator.
Equally important in practice is protecting capitals. Many styles recast a title into sentence case, which would mangle proper nouns and acronyms like NASA or TeX into Nasa or Tex. Wrap the span you want to keep in an extra pair of braces — title = {On the {NASA} Mission to {TeX}} — and it is shielded from the change.
@string macros and comments
If the same value recurs, you can define a macro with @string. Use the defined name in a value position (unbraced), and concatenate with #. This is handy for switching between abbreviated and full journal names.
@string{bstj = {Bell System Technical Journal}}
@article{shannon1948,
author = {Shannon, Claude E.},
title = {A Mathematical Theory of Communication},
journal = bstj,
year = {1948}
}A common myth needs clearing up about comments: **in a .bib file, % is not a comment character** (unlike the LaTeX body). Classic bibtex **ignores any text outside an entry (@...{}), so a note placed as ordinary prose between entries does no harm. But biber (biblatex’s backend) is stricter and warns about stray text outside entries. The portable form is @comment{ ... }**, whose contents are skipped entirely.
The order of the list
The order entries appear in is unrelated to the order you wrote them in the .bib. How it is decided splits along two mechanisms:
**Under classic BibTeX, the order is fixed by the style (.bst).** You have almost no say; choosing the style *is* choosing the order. For instance plain and alpha sort alphabetically by author, while unsrt uses order of first citation, as do engineering styles like ieeetr. With the same data, switching from \bibliographystyle{plain} to \bibliographystyle{unsrt} changes the order. For Japanese, pbibtex / upbibtex sort by code point (see the [BibTeX page](/learn/bibliography/bibtex-page)).
**Under biblatex you control the order explicitly with the sorting= option** — independent of the style, just \usepackage[sorting=nyt]{biblatex}. Sort keys are spelled as letter combinations: n = name, y = year, t = title. The common choices:
| Option | Key order | Meaning |
|---|---|---|
nty | name → title → year | Name, then title, then year (biblatex default) |
nyt | name → year → title | Name, year, title (favored for author–year) |
ynt | year → name → title | Year, then name, then title (chronological) |
ydnt | year (descending) → name → title | Newest year first, then oldest |
none | (no sorting) | Order of citation (the unsrt equivalent) |
In short: to keep citation order, choose the unsrt style under BibTeX or sorting=none under biblatex. For alphabetical order, use plain under BibTeX or the default nty under biblatex (or nyt for author–year). Either way, you never reorder the entries in the .bib — deciding the order is entirely the tool’s job.