Anatomy Of The National Drug Code

The U.S. Food and Drug Administration (FDA) created the concept of the National Drug Code (NDC) in 1969 to “…provide an identification system in computer language to permit automated processing of drug data by Government agencies, drug manufacturers and distributors, hospitals, and insurance companies” (from 34 FR 11157, July 2, 1969).  (I can’t find a copy online of the original Federal Register article from 1969 so I’m relying on a more recent article that references it.)   Those of us in the U.S. pharma supply chain make use of NDC’s every day, but very few of us know the history of their development, exactly how the numbers are composed and what they mean.  I’ll try to explain all of that and provide sources for further reading.


The NDC was initially a voluntary identifier (see references at the end of this essay).  We all know how that would have turned out (for more on that thought, see my recent essay “Should Regulations Dictate Technology?“) so in 1972 the FDA made the NDC mandatory for all prescription and over-the-counter (OTC) drugs.  Manufacturers were required to obtain a “Labeler Code” from the FDA, construct their NDC’s using that code as the base and print the NDC number on drug packages.  Barcodes were not required by the FDA back then.

From the quote in the first paragraph above you can see that the FDA intended the NDC to be used among the full spectrum of users who needed to unambiguously refer to specific drugs.  I can’t imagine how inefficient it must have been to refer to a specific form, size and concentration of a particular drug in every step between manufacturer, patient and insurer before the advent of the NDC.  Even from the very start the FDA intended the NDC to help with automation using computers.  Computer automation leads to greater efficiencies and much greater data accuracy–just what was needed for the drug industry and supply chain to grow in the coming decades.

The FDA recognized in the early 1970’s the automation value of encoding the NDC into barcodes, but as I said, they didn’t require them.   However, barcodes were making a big splash in the grocery industry and soon after in the consumer products goods industry around that time because of the great gains experienced in checkout efficiency and inventory control.  The Uniform Grocery Code Council (UGCC) introduced the 12-digit Universal Product Code (UPC) identifier and barcode symbology in 1974 and it quickly became the standard for all products sold at checkout counters.  Chain stores of all kinds started putting maximum pressure on manufacturers to put a UPC barcode on every product they sold.

This led to an interesting collision of mandates.  The FDA had already mandated that OTC drugs be identified by their NDC.  The UGCC mandated that the “Company Prefix” portion of the Universal Product Code that was encoded in UPC barcodes be assigned by the UGCC.  Since OTC drugs were one of the products that were being sold by chain stores, pressure was put on the UGCC to find a way to accommodate the 10-digit NDC within the 12-digit UPC.

UGCC technical experts quickly came up with a way to do it.  They came up with the scheme of pre-pending the NDC with the digit ‘3’ and then adding the standard UPC checksum at the end.  The UGCC had to commit to reserving all UPC’s with a ‘3’ as the first digit for drug companies and they agreed to reserve the Company Prefixes for drug companies so that they matched the FDA’s Labeler Code.  OTC drug manufacturers now had a way to satisfy both mandates and many years later that approach continued to be used as manufacturers started to apply barcodes to non-OTC drug packages.

Around that time the UGCC became the Uniform Product Code Council (UPCC), then the Uniform Code Council (UCC) in 1984, and finally became GS1 U.S. in 2005.  All along the organization has been a privately held, non-profit, tax-exempt corporation.

While the printing of the human readable NDC on drug packages was mandatory the printing of a barcode on drugs was voluntary until only relatively recently.  The FDA published a final rule  in 2004 that mandated all drug packages have a linear barcode printed on them starting in 2006.  By 2004 roughly 90% of drug packages in the supply chain already had linear barcodes on them voluntarily.  It seems odd that it took the FDA so long to mandate such a valuable automation element when it seems like it could have mandated it much earlier with little justifiable complaint from the industry.  The final rule document contains a significant amount of discussion, explanation and documentation about the benefits of barcodes on drug packages, particularly around the benefits to patient safety.


The NDC is composed of three semi-fixed-length data fields:

  • FDA Labeler Code
    This is a code that is assigned by the FDA to the manufacturer, packager (“labeler”) or repackager of the drug as part of an application process.
  • Product Code
    This is a code that is selected by the owner of the FDA Labeler Code.  It represents the unique combination of the drug, the dosage form and strength that will be packaged by that owner.  While the code is assigned by the owner of the Labeler Code it must be registered with the FDA.
  • Package Size
    This is a code that represents the package size or package grouping of the drug.

For a short time the NDC started out in 1969 as a 9-digit code.  Initially the Labeler Code was defined as 3 alphanumeric characters long–a fixed length–but was soon changed to 4 numeric digits bringing the full code to the full 10-digits we know today.  The product code was defined as a fixed 4 digits long and the package size took up the remaining 2 digits.  But Labeler Code assignment requests came it at an alarming rate and it apparently wasn’t slowing down as they started to approach 999 sequential code assignments.

A decision had to be made.  If they crossed the border and assigned Labeler Code 1000, the NDC would forever be limited to 4 digits with a maximum of 9,999 codes and they might run out someday.  They were already approaching 10% of that number.  But if they made the fields of the NDC semi-fixed length at either 4 or 5 digits, they could continue assigning codes until a theoretical maximum of 99,999 codes.

The FDA didn’t want to expand the NDC to 11 digits so they decided to remove one digit from either the Product Code or the Package Size fields.  Rather than picking one or the other they decided to leave that choice up to each owner of the new 5 digit Labeler Codes.  Those companies could choose to have only 3 digits for the Product Code and 2 for the Package Size (written as 5-3-2), or they could choose to have 4 digits for the Product Code and only one digit for the Package Size (written 5-4-1).  The decision is made by the owner and they must register their choice and stick with it for the life of the Labeler Code.

But there is a problem with this approach.  Given a 10-digit NDC that might have a 4-digit or a 5-digit Labeler Code there could be conflicts between the NDC’s of two different companies.  Two companies might end up generating the identical NDC for two different products.  To eliminate this potential problem they decided to never assign labeler codes 1000 through 9999 (actually there is no explicit rule published that the FDA is following this technical requirement but it appears that this is what they are doing for most new Labeler Codes).  This makes the actual maximum number of Labeler Codes available equal to 90,999…not a bad compromise.

This solution provides a well-defined rule that allows systems to easily figure out the length of the Labeler Code within a given 10-digit NDC number.  All NDCs assigned by companies who own a 4-digit Labeler Code will always have a zero in their leftmost position and all NDC’s assigned by companies who own a 5-digit Labeler Code always have a non-zero digit in their leftmost position.  But there is no easy way to figure out if the owner of a 5-digit Labeler Code is using the 5-3-2 form or the 5-4-1 form without looking it up in a database.

The Package Size field is an important field used to differentiate not only the various dosage form sizes of the packages that the manufacturer or repackager produces (i.e. 30-count, 60-count, 90-count), but also the casepack quantities of each of that same set of packages.  There are no standard values for the Package Size field so the values used for one manufacturer cannot be compared with those of another.  They are simply used to differentiate package sizes and groupings within a single product type causing considerable confusion to those who wish to make use of this field.

For example, Company A might choose to use the values ’30’, ’60’ and ’90’ to represent the Package Size codes for their 30, 60 and 90 count bottles of a given drug, and the values ’31’, 61′ and ’91’ to represent a single casepack quantity of 48 bottles for the 30 pill bottle, and 24 bottles for the 60 and 90 pill bottles.  Company B might have chosen the 5-4-1 form of the NDC so they are left with only a single digit to represent their Package Sizes and groupings.  They might choose values ‘1’, ‘2’, and ‘3’ for their 30, 60 and 90 count bottles of a given drug, and the values ‘6’, ‘7’ and ‘8’ to represent the single casepack quantity of 96 bottles of their 30-count bottle, 48 bottles of their 60-count bottle and 24 of their 90-count bottle.  Confused yet?

So what use is this Package Size field if there isn’t any standard?  It simply allows manufacturers and repackagers to create unique NDCs for each dosage form size and casepacks so that interested parties can use it to look up the other information in a database.  You can’t just look at an NDC and know exactly what it stands for unless you have some prior knowledge about the choices the manufacturer or repackager has made for that product.  A database lookup doesn’t care what values are chosen for each packaging level or grouping as long as they are each unique.


The current design of the NDC results in a number of ambiguities that stem from the fact that the length of each of the three fields can be one of two values.  The National Council for Prescription Drug Programs (NCPDP) decided to fix the ambiguity to increase the accuracy of claims submission.  They saw that all you have to do to return to a fixed length set of fields is to add an eleventh digit.  The goal was to always end up with a 5-4-2 format for all NDC’s.  To all 4-digit labeler codes (4-4-2) they added a ‘0’ on the left.  To any 3-digit Product Code fields (5-3-2) they added a ‘0’ on the left.  To any 1 digit Package Size (5-4-1) they added a ‘0’ on the left.  All of these resulted in a 5-4-2 format (11 total digits).

For their purposes I’m sure this works great.  But it introduces its own ambiguity when an 11-digit “pseudo-ndc” is offered where a 10-digit true NDC is needed.  Which zero is the extra zero?  You can’t always tell unless you know for a given NDC.  Incidentally, the FDA apparently doesn’t recognize the NCPDP 11-digit format so it is not a real NDC.  That’s why I’ve called it a “pseudo-ndc”.


There is one more thing I want to say about NDCs.  I think the FDA made a significant error in not defining the NDC in a way that requires all pharma manufacturers and repackagers to clearly identify which NDC is a unit dose or unit-of-use for each drug.  The NDC appears to have been conceived as a way for a manufacturer to assign a unique code for each type of package they make for a given drug.  Since most manufacturers currently do not produce packages that contain a single unit dose or unit-of-use there is theoretically no need for them to define an NDC for that level.  I am told that some manufacturers do define and register an NDC for this level even if they don’t package at that level, and the rest do not.

I imagine that this has caused serious heartburn for insurers and Pharmacy Benefit Managers (PBMs) who are probably given the NDC for the original manufacturer’s bottle that a prescription was filled from.  What does it mean for a pharmacist to claim that they filled a prescription with ‘1’ of NDC 9999988882 (psuedo-ndc 99999888802 for claims submission) where that NDC describes a 30-count bottle?  Did the patient receive one 30-count bottle or did they receive a single pill that the pharmacist pulled from a 30-count bottle?  There must be some convention for limiting the ambiguity that this introduces.  Perhaps someone can leave a comment to explain what happens in this instance.

In my view all manufacturers and repackagers should always generate and register an NDC for a unit dose or unit-of-use.  Ideally you’d like to think that the Package Size values of either ’00’ or ‘0’ would be reserved to indicate the unit dose or unit-of-use, but since it wasn’t defined that way you will probably have lots of drugs that assign those values to some multi-dose/-use package or even a casepack.  It would be too disruptive to force that kind of change on the industry now.


Normally I provide links to all my references, but there are a couple of sources that I drew from for lots of this content and so I’d like to list them here:

Please submit a comment if you have additional information, clarifications or corrections.


Other essays you may be interested in:

One thought on “Anatomy Of The National Drug Code”

  1. It is worth noting that the US Patent and Trademark Office issued a series of patents that cover the decoding of the various NDC formats. You have to pay annual fees to extract comports of the NDC. Just plain wrong for a governmt controlled and mandated identifier.
    I suggest the use of delimiters but that might break OTC bar codes.
    I agree that it was a big mistake not requiring an NDC for unit dose.

Comments are closed.