Method and evidence

How COMPARE works

Learn about the COMPARE app, data, methodology, limitations, and sources.

Where the data comes from

COMPARE reads drug labels from openFDA, the US Food and Drug Administration's open data service1. Each label is the text the manufacturer filed for a product. The same labels are published on DailyMed2. Your browser asks the openFDA service for labels when you search, and nothing passes through a server of ours.

openFDA tells users to assume its results are unvalidated and not to rely on them for medical decisions. COMPARE repeats that warning because it applies to everything shown here.

How a label is structured

openFDA stores each label as one record. Each section of the label is a field holding a list of text strings, for example the indications section or the adverse reactions section. Where a section has tables, they come in a separate field as HTML. Two label formats exist side by side:

  • Newer format. Required for current prescription labels3. The sections are numbered 1 to 17 (1 Indications, 2 Dosage, 5 Warnings and precautions, 6 Adverse reactions and so on), with numbered subsections such as 5.1.
  • Older format. No numbers, and some sections are named differently. Warnings, precautions and general precautions are separate sections where the newer format has one.

Section matching

COMPARE shows one menu entry per kind of section and gathers the matching fields under it, so that old and new labels line up in a comparison.

Menu entryFields used, in order
Warnings and precautionswarnings_and_cautions, then warnings, precautions and general_precautions as small headings
Use in specific populationsuse_in_specific_populations, then pregnancy, nursing mothers, lactation, pediatric use, geriatric use and related fields
Clinical pharmacologyclinical_pharmacology, then mechanism of action, pharmacodynamics, pharmacokinetics
How supplied and storagehow_supplied, then storage_and_handling
Patient counseling informationinformation_for_patients, then the patient package insert
OtherEvery other text field in the record, under its own name, so nothing is hidden

The menu lists a section if at least one of the labels has it, and shows how many do when it is not all of them. The groups are About, Use, Safety, Science, Supply and patients, and Other.

What is cleaned

  • Repeated title. Labels begin each section with its title, for example 1 INDICATIONS AND USAGE. COMPARE removes it because the title is already the heading.
  • Subsection numbers. Numbers such as 5.1 sit inside the running text. COMPARE starts a new paragraph at a number only when it begins a sentence and belongs to that section, so cross-references such as see Section 5.1 are left alone. The number is shown as a small label.
  • Spacing. Extra spaces and line breaks are tidied.
  • Tables. Tables are rebuilt from the cells' text, so formatting and links inside a table are dropped.

No words are rewritten, summarized or reordered. No AI is used. The same labels always produce the same page.

How comparison works

A comparison puts the same section of two or three labels in a row. Each label's section is turned into plain text first, with subsection numbers kept and small headings marked.

When Mark words that differ is on, the text of each later label is compared word by word with the first label, using the longest common sequence of words (the method behind most text comparison tools). Words in a later label that are not part of that shared sequence are marked. Capital letters and punctuation are ignored, so Adults: and adults count as the same word. Words that are only in the first label are not shown. Very long sections use a simpler check, which marks a word if it appears nowhere in the first label.

The comparison shows wording differences. It does not say which differences matter clinically, and it does not match numbers inside tables across labels. A different order of sentences can show up as many marked words even when the meaning is the same.

What is missing

  • Most biologics. Vaccines and most biologic medicines are licensed differently and are mostly not in this label data.
  • Labels without a product link. Some current labels carry no product names in the openFDA record. A name search cannot find them.
  • Images and layout. Pictures, structure drawings, charts and the original page layout are not in the data.
  • Currency. openFDA is updated on its own schedule. The label date shown is the date on the label, not the date it was fetched. DailyMed holds the current version.

What has been checked

  • The cleaning, section-matching and comparison rules have automated tests on made-up labels in both formats, including labels with unfamiliar fields, empty fields, tables, and texts that differ by one word, one phrase or entirely.
  • The pages were exercised in a browser with those labels: search, picking labels, the section menu, marking differences, removing a label, links and print.
  • Not yet checked: a systematic comparison against a large sample of real labels. Real labels vary, so some will not clean perfectly. When the cleaned text looks wrong, open the label on DailyMed.

Sources

  1. [1] U.S. Food and Drug Administration. openFDA: drug labeling API. open.fda.gov/apis/drug/label
  2. [2] National Library of Medicine. DailyMed. dailymed.nlm.nih.gov
  3. [3] 21 CFR 201.56 and 201.57. Requirements on content and format of labeling for human prescription drug and biological products. eCFR