LabelNation: a command-line label-printing program

Latest version: 1.233   (22 Dec 2025)

LabelNation is a command-line program for making labels: address labels, business cards, or anything else involving regularly-arranged rectangles on a printer-ready sheet. It is for users who are comfortable dealing with text- and option-based configuration, as opposed to a graphical user interface.

LabelNation is free / open source software, written in the Python 3 programming language, and licensed under the Affero GNU General Public License 3.0 (AGPL-3.0).

Sample sheet of LabelNation output, fetchingly rotated for maximum mystery.

Overview

Here's how it works: you tell LabelNation what text you want on each label. You can specify plain lines of text, or even arbitrary PostScript code. You also tell it what kind of labels it should print for. LabelNation takes all this information and produces a PostScript file, which you then either send to your printer (many support PostScript directly) or run first through a conversion tool such as ps2pdf to produce a PDF which you can then print.

Of course, there must be a sheet of peel-off labels in the printer's paper tray. Such sheets are widely available at office supply stores. Two companies that offer it are Avery Dennison and Maco. This is not a recommendation nor an endorsement; Avery and Maco are simply the names I've seen.

LabelNation does automatic font resizing to fit all the lines of text on the label, supports the usual accented characters (á, à, ó, etc, from ISO 8859-1).

For more information, see:

Supported Labels

LabelNation has built-in knowledge of the following standard label types:


  2 labels per page:           Avery-5444
  4 labels per page:           Avery-5168
  6 labels per page:           Avery-5264                             
  10 labels per page:          Avery-5263, 5663, 5963, 8163
  20 labels per page:          Avery-5161, 5261, 5661, 5961
  14 labels per page:          Avery-5162, 5262, 5662, 5962, 8162, 8252, 8462,
                                     15162, 18162, 18662
  30 labels per page:          Avery-5160, 5260, 5660, 5960, 5970, 5971, 5972
                                     5979, 5980, 6241, 6460, 6245, 8660
                               Brady-Lasertab-53-361
                               Maco-LL5805
  60 labels per page:          Avery-6520
  80 labels per page:          Avery-5167, 5267, 5667, 6467, 8167
                               Maco-LL8100                            
  10 business cards per page:  Avery-5371, Maco-LL8550
  45 labels per page:          Brady-Lasertab-52-361
  49 labels per page:          Cable-Labels-LSL-77 (or "-LS10-77S")
  84 35mm slides per page:     SlidePro, SlideScribe
  16 labels per page:          Avery-7162
  14 labels per page:          Avery-7163
  32 labels per page:          Avery-6571
  21 labels per A4 page:       Avery-7160
  24 labels per A4 page:       Avery-7159
  65 labels per A4 page:       Avery-2651, 7651
  8 labels per 10" page:       Avery-2160, Maverick-ST340817

Types not listed above are still supported — you just have to tell LabelNation what sizes the labels are, and how many per page vertically and horizontally. (And then please send in your parameters, so there will be built-in support for those labels in future releases.) This chart of common label dimensions may help.

Reporting Bugs / Contributing New Label Types / Etc

If you have a bug to report, or would like to send in parameters for a new label type, please file a ticket at code.librehq.com/kfogel/labelnation.

Other Programs That Do Similar Things

There seem to be a lot of open source programs that perform a similar function.

Labelle looks interesting: a label-printing program that can handle text, QR codes, barcodes, images, or any combination of the preceding. It supports both graphical and command-line operation. From looking it over — I haven't actually used it — it seems meant for dedicated label-making hardware (e.g., DYMO LabelManager / LabelPoint devices). I didn't see any way, from a quick glance through their docs, to just output a PDF for printing on a regular printer, but maybe it's there and I just missed it.

LabelGrid is an open source project to do label printing purely through web-based technologies. I haven't tried it.

GLabels "is a program for creating labels and business cards for the GNOME desktop environment. It is designed to work with various laser/ink-jet peel-off label and business card sheets that you'll find at most office supply stores." Again, haven't used it myself.

Worldlabel.com offers free templates for making labels using OpenOffice.org, the open source office suite.

You might also want to try the PostScript::MailLabel Perl module. I've never used it, but it looks like it does basically the same thing. I think it can handle bar-codes too.

(This isn't open source, but: there seem to be a number of templates at Google Docs that offer label formatting essentially as an online service.)

Barcodes

LabelNation does not natively generate barcodes. However, fsBarcodes is "a simple python script that uses postscriptbarcode and LabelNation to generate barcode labels. It can be used to generate a sequence of barcode labels over any range (you can specify), and can also generate repeated barcode labels of any value."

Also, the PostScript::MailLabel Perl module mentioned earlier apparently does barcodes.

I would welcome patches to give LabelNation native barcode support.

brought to you by red-bean