Guide

Best-before dates and batch numbers on product labels

Let the label work out the dates: the day you pack, a best-before date 30 days or 6 months later, and a batch code made from the date.

Updated

Start a dated label

Dates that fill themselves in

In the label designer, a word in double curly brackets is a field: it is filled in when the label is drawn. {{today}} is the date you print. Add days (d), weeks (w), months (m) or years (y) to move it, and a format after a bar (|) to choose how it is written:

You typeIt prints, on 21 October 2026
{{today}}10/21/2026 on a US computer, 21/10/2026 on a UK one
{{today+30d}}11/20/2026 on a US computer, 20/11/2026 on a UK one
{{today+30d|DD MMM YYYY}}20 NOV 2026 on every computer
{{today+6m|MMM YYYY}}APR 2027
{{today-2w|D Mmm YYYY}}7 Oct 2026
{{today+1y-1d|DD/MM/YYYY}}20/10/2027
Best before {{today+30d|DD MMM YYYY}}Best before 20 NOV 2026

Type the words around a field as usual. Moving by months keeps the day of the month, or takes the last day of a shorter month: one month after 31 January is 28 February (29 February in a leap year), as in Excel.

  1. Start a label

    The button below opens the designer with one text box on 2 × 2 inch labels, 12 per sheet. Click the text and type your own in its box, such as Best before {{today+30d|DD MMM YYYY}}.

  2. Or let the designer write the field

    Under the text’s box, Today’s date puts {{today}} in. Dates, prices and numbers… opens a pop-up where you choose how far to move the date and how it looks, and shows what it will print before you insert it.

  3. Print

    Open Print. Before anything is printed, it says which date “today” is on these labels.

Start a dated label Open the designer

A date with no format follows your computer

{{today}} on its own, and any date you move without giving it a format, is written the way the computer or phone you print from writes short dates: month first on a US computer (10/21/2026), day first on a UK one (21/10/2026), with dots in Germany (21.10.2026). So the same label can show the date two ways on two computers.

To make a date look the same everywhere, give it a format of its own: {{today|MM/DD/YYYY}} for 10/21/2026, {{today|DD/MM/YYYY}} for 21/10/2026, or {{today|DD MMM YYYY}} for 21 OCT 2026, which can’t be read the wrong way round.

In the Dates, prices and numbers… pop-up, the first choice under “Show it as” is this device’s own way, with today’s date in it, so you can see what a date with no format will look like on your computer.

Choose how the date looks

A date format is made of these codes. Capitals don’t matter (dd/mm/yyyy works too), except in names: write a name in capitals and it prints in capitals.

CodeMeansIt prints, for 21 October 2026
D or DDThe day, without or with a zero in front21 (5 or 05 on the 5th)
M or MMThe month as a number10 (1 or 01 in January)
MMM or MmmThe month’s short nameOCT or Oct
MMMM or MmmmThe month’s full nameOCTOBER or October
YY or YYYYThe year26 or 2026
Ddd or DdddThe weekday, short or fullWed or Wednesday
JJJThe day of the year294 (005 on 5 January)

Anything else in a format prints as written, such as slashes, dots, commas and spaces. Put words in double quotes: {{today|"Packed" DD.MM.YY}} prints Packed 21.10.26. Month and weekday names are in English.

You don’t have to remember the codes: Dates, prices and numbers… lists the usual forms with today’s date in them, such as 21 Oct 2026 and 2026-10-21.

Batch and lot numbers

A batch or lot number lets you find everything made in one go again. There is no single rule for what it looks like: use the form your own records use. Some ways to print one:

  • From a column of your datalist: Lot {{Batch}} prints Lot B1027 for a Batch cell of B1027.
  • From the date: L{{today|YYJJJ}} prints L26294, the year and the day of the year (21 October 2026 is day 294 of the year; this is sometimes called a Julian date). {{today|YYMMDD}} prints 261021.
  • A number on each label: {{#|0000}} prints 0001, 0002, 0003 and so on, a different number on every label.
The top half of a sheet of 2 by 2 inch square labels, each with a product name such as Strawberry jam, Best before 21 APR 2027, Lot L26294 and a small square GS1 DataMatrix code
Jar labels with Best before {{today+6m|DD MMM YYYY}} and Lot L{{today|YYJJJ}}, printed on 21 October 2026. The products and numbers are made up.

Keep the date of a batch

“Today” is the date on the computer or phone you print from, by its own clock. It is fixed once for each print job, so every label in the job has the same date, and the print step says which one: “Today” on these labels is 10/21/2026 (the date on this device).

A web page can’t know when a batch was made. To print more labels for the same batch next week, keep its date: open Label, find Dates, and under “Today” prints choose One date I choose, then pick the date. Every reprint uses that date until you change it back to The day you print, and it is kept with the label when you save it.

The Dates settings appear under Label as soon as the label prints a date.

Dates from a spreadsheet

When every batch has its own date, keep a spreadsheet with a row for each, with columns such as Name, Made and Batch, and add it with Add a datalist. A date column can be moved and formatted just like {{today}}: {{Made+18m|MMM YYYY}} prints APR 2028 for a Made date of 21 October 2026.

EncodeLabel reads dates written 2026-10-21, 21/10/2026, 10/21/26, 21 Oct 2026 or October 21, 2026, and Excel’s own date numbers (46316 is 21 October 2026). A workbook that counts dates from 1904, an older Mac setting, is read that way.

  • 03/04/2026 could be 3 April or March 4. EncodeLabel never guesses: the cell prints as it is in your list, and Check every row lists it. Choose Day first or Month first under Label, Dates. When you insert the date with Dates, prices and numbers… and a row such as 13/04/2026 shows which way round your list writes dates, the designer chooses for you and says which row told it.
  • A cell that isn’t a date, such as “soon”, prints as it is, and Check every row lists it too.
  • An empty cell prints nothing.

Dates in a GS1 barcode

Some customers ask for the product number, a date and the batch in one barcode, as a GS1-128 or a GS1 DataMatrix. In GS1 data each part starts with its Application Identifier in brackets: (01) is the product number as 14 digits, (17) an expiry date written YYMMDD, and (10) the batch or lot. Fields work in a barcode’s value too:

(01){{UPC|GTIN-14}}(17){{Made+18m|YYMMDD}}(10){{Batch}}

For a row with the UPC 400000400020, made on 21 October 2026 in batch B1027, that is (01)00400000400020(17)280421(10)B1027. {{UPC|GTIN-14}} writes a 12-digit UPC or a 13-digit EAN as 14 digits, with zeros in front. Put the parts with a fixed length, (01) and (17), before the batch.

GS1 has Application Identifiers for other kinds of date too. Which one your product needs, if any, is for GS1 or your customer to say. (The UPC above is a made-up example. Use your own numbers.)

Which date your product needs

EncodeLabel prints the date you choose, in the form you choose. Which date a product needs (a use-by date, a best-before date or none), and how it must be written, depends on the product and where it is sold. This guide isn’t legal advice: check with the food authority where you sell.

Two places to start reading:

Label paper

Any label paper in the list works. Some that suit jars, pots and small boxes:

On 2 × 2 in labels On 1 × 2⅝ in labels On a 2 × 1 in roll

Before the first real sheet, open Print, then Line it up, and choose Print a test page. Print it on plain paper and hold it against a sheet of labels, up to a window. It never counts toward your labels.

Try it

Free for up to 100 labels a month. No account needed. Your labels are made in your browser.

Start a dated label Printing help

Feedback

Suggestions and feedback

What would make EncodeLabel better, or what isn’t working? It goes straight to the people who run the site.

Only if you’d like a reply.

We use your email only to reply to you. Please don’t include passwords or private details. Privacy Policy

Add EncodeLabel to your Home Screen

One tap to your labels, like an app, with nothing to download from an app store.