GS1 DATA TOOL
GS1 YYMMDD date decoder
See the ISO date, month-end interpretation for day 00 and calendar validation warnings.
Inputs
Results
Run the sample to see decoded fields and checks.
ON THIS DEVICE
Recent history
RULES USED
Method and formulas
GS1 dates use YYMMDD. Day 00 is interpreted as the last day of the stated month where the relevant AI permits that convention.
Century selection depends on business context. Confirm the intended century and the specific AI’s rules in the current specification.
GUIDE
What this tool does / when to use it
The GS1 YYMMDD date decoder interprets six-digit date strings embedded in GS1 data carriers according to the official Application Identifier definitions. AI 11 records the production date of a trade item while AI 13 records the packaging date. AI 15 marks the best-before date indicating the end of the period when the product is expected to retain its specified quality under proper storage. AI 17 marks the expiration date after which the item must not be sold or used. The decoder accepts a YYMMDD value together with the selected AI and returns a human-readable calendar date. It applies the GS1 rule that a day field of 00 represents the last day of the month when the relevant AI permits that convention. Supply-chain operators, quality auditors and warehouse systems rely on this conversion to verify traceability records, manage stock rotation and meet regulatory requirements for food, pharmaceuticals and medical devices. The entire decoding process occurs locally inside the browser using only the supplied input values and the published GS1 date rules.
Users encounter these date codes during barcode scanning, EDI message parsing or manual data entry from printed labels. Correct interpretation prevents miscalculation of shelf life and avoids incorrect rejection or acceptance of goods. Because the century portion of the year is not encoded, the tool presents the two-digit year exactly as supplied and leaves final century assignment to the operator who possesses the necessary business context.
Worked example with realistic numbers
Consider the input string 271231 paired with AI 17. The decoder reads YY as 27, MM as 12 and DD as 31, producing the date 2027-12-31. A second example uses 250200 with AI 15. Because the day field equals 00 the tool returns the last day of February 2025, which is 2025-02-28 in a non-leap year. A third example 240229 with AI 11 yields 2024-02-29 because 2024 is a leap year and the day field is valid. These examples illustrate how the decoder applies both the standard YYMMDD mapping and the special 00-day rule while respecting leap-year arithmetic.
| AI | Input Code | Interpreted Date | Notes |
|---|---|---|---|
| 17 | 271231 | 2027-12-31 | Standard day value |
| 15 | 250200 | 2025-02-28 | Day 00 maps to month end |
| 11 | 240229 | 2024-02-29 | Valid leap day |
| 13 | 230630 | 2023-06-30 | Packaging date |
Formula / method table
| Input Field | Format | Output | Unit |
|---|---|---|---|
| YY | Two digits | Year portion | Calendar year |
| MM | 01-12 | Month | Calendar month |
| DD | 00-31 | Day or month-end | Calendar day |
| AI selector | 11,13,15,17 | Context label | Application Identifier |
The method extracts the three two-digit groups, validates the month range, checks the day against the month length including leap-year February, and substitutes 00 with the appropriate final day when allowed. No external lookup tables or network calls are required.
Units and conversions notes
All dates remain in the Gregorian calendar. The YY field is never expanded to four digits by the decoder; the operator must apply the correct century based on product lifecycle or regulatory horizon. Month 00 and day values outside the valid range for the given month are rejected. The 00-day convention is permitted only for the AIs listed in the current GS1 General Specifications and is not applied uniformly to every date element. Conversion therefore consists solely of positional parsing plus the single conditional replacement of 00 with the month-end value.
Limitations
The decoder cannot determine the intended century without additional business context. It does not cross-check the decoded date against other GS1 elements such as batch or serial numbers. Leap-year detection follows standard Gregorian rules but cannot anticipate future calendar reforms. The tool also does not enforce sector-specific rules such as maximum shelf-life periods that may be defined by local legislation.
Common mistakes
Operators sometimes assume a fixed century prefix such as 20 for all YY values, which produces incorrect dates for items manufactured before 2000 or after 2099. Another frequent error is applying the 00-day rule to AIs that do not allow it. Users may also overlook that February 29 is valid only in leap years and therefore submit invalid codes such as 230229. Finally, entering a month value outside 01-12 or a day value greater than 31 without checking the AI selector leads to silent rejection or misinterpretation of the input string.
COMMON QUESTIONS
Frequently asked questions
How is day 00 interpreted in a GS1 date for AI 15?
Day 00 is replaced by the final calendar day of the month given in the MM field. For February this yields either the 28th or 29th according to leap-year status. The rule applies only when the selected AI permits month-end substitution.
Which Application Identifier uses YYMMDD for packaging dates?
AI 13 is reserved for packaging dates. The decoder applies the same YYMMDD parsing logic but labels the output with the packaging context so downstream systems can distinguish it from production or expiration dates.
Can the decoder accept 000000 as a valid input?
The string 000000 produces an invalid month and is rejected. No AI permits a month of 00, so the tool returns an error rather than attempting any substitution.
What happens when YYMMDD equals 990229?
The month 02 and day 29 are checked against leap-year rules for 1999. Because 1999 is not a leap year the code is rejected as an invalid date.
How does AI 17 expiration differ from AI 15 best-before in date handling?
Both use identical YYMMDD syntax and the 00-day rule, yet the semantic meaning changes: AI 17 indicates the date after which the item must not be used while AI 15 indicates the date until which quality is assured. The decoder supplies the same calendar date but preserves the AI label for correct interpretation.
Does the tool validate the decoded date against current system time?
No. The decoder performs only syntactic and calendar validation. Any comparison with today's date or with other GS1 fields must be done by the calling application.
What century assumption is required for YY values above 80?
Values such as 85 could represent 1985 or 2085. The operator must supply the correct century using product records or regulatory context because the six-digit format contains no century indicator.
Is the 00-day rule permitted for AI 11 production dates?
The GS1 specification allows the 00 convention only for certain AIs; AI 11 production dates follow the same rule when the day field is 00. The decoder therefore applies the month-end substitution consistently across the supported identifiers.