> For the complete documentation index, see [llms.txt](https://help.docexport.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.docexport.com/template/1d-barcode.md).

# 1D Barcode

This article explains how to turn a column from your monday.com board into a **scannable 1D barcode** in the document that DocExport generates. It supports two barcode types: **Code 39** and **Code 128**. We first help you decide which one you need, then walk you through the setup once, side by side, for both.

Barcode generation works entirely through free barcode fonts: you write the barcode value as text in a monday.com column and when DocExport generates the document it converts that value into a font that a scanner can read as a barcode.

<figure><img src="/files/ZIeciaNsqIZnkCjOTSll" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Board requirement:** You need a column that holds the barcode values. This works with both a **Text column** and a **Numbers column**.
{% endhint %}

***

### Which barcode type do you use/need?

Before you set anything up, decide which code is used for your use case. The two types work differently:

* **Code 39** maps each character to a **fixed** bar pattern, so the font alone can render it. You mark the start and end yourself with an asterisk (`*`), and there is no checksum. It only supports **digits, uppercase letters, and a few symbols** (`- . $ / + %` and space). It is the simplest option and needs no extra tools - but it produces wider codes and can't store lowercase letters.
* **Code 128** is more capable but needs one extra step. It supports the **full ASCII range including lowercase letters**, is much more **compact** (it can pack two digits into a single symbol), and includes a **mandatory checksum** for more reliable scanning. The catch: a font cannot calculate the required checksum and start/stop characters, so you must run your text through an **encoder** first and store the already-encoded string in your monday.com column.

#### Use this as a guide

<table><thead><tr><th width="339.328125">Application area</th><th width="160.23046875">Often used code</th><th>Why</th></tr></thead><tbody><tr><td><strong>Simple internal product labels</strong> (furniture, household goods, basic articles)</td><td>Code 39</td><td>Short, uppercase/numeric SKUs</td></tr><tr><td><strong>Office, files, asset tags, membership/ID cards, event tickets</strong></td><td>Code 39</td><td>Small data volumes, easy to maintain, works with legacy systems.</td></tr><tr><td><strong>Library, archive, schools</strong></td><td>Code 39</td><td>Long-established standard for short item numbers.</td></tr><tr><td><strong>Government, defense, automotive (legacy systems)</strong></td><td>Code 39</td><td>Historically mandated; still widely supported.</td></tr><tr><td><strong>Food &#x26; retail packaging</strong> (batch, best-before, lot data)</td><td>Code 128</td><td>Compact and alphanumeric; GS1-128 is the industry standard for this data.</td></tr><tr><td><strong>Logistics &#x26; shipping</strong> (parcels, pallets, cartons)</td><td>Code 128</td><td>GS1-128 / SSCC shipping codes are built on Code 128 - the global standard.</td></tr><tr><td><strong>Warehousing &#x26; inventory</strong></td><td>Code 128</td><td>Long alphanumeric SKUs and location codes fit in little space.</td></tr><tr><td><strong>Healthcare</strong> (patient wristbands, medication, specimens)</td><td>Code 128</td><td>Compact alphanumeric codes; reliable thanks to the built-in checksum.</td></tr><tr><td><strong>Manufacturing</strong> (serial numbers, part tracking)</td><td>Code 128</td><td>High data density on small components; supports the full character set.</td></tr><tr><td><strong>Any code with lowercase letters or many characters</strong></td><td>Code 128</td><td>Code 39 only supports uppercase and a limited character set.</td></tr></tbody></table>

{% hint style="success" %}
**Rule of thumb:** If you just need to label and scan simple products and control your own (uppercase/numeric) codes, it´s almost always **Code 39** that is being used. As soon as it involves shipping/logistics, standardized labels, long or mixed-case data, or tight space, **Code 128** is used.
{% endhint %}

***

### Step-by-step setup (for both codes)

The steps below work for either barcode type. Where Code 39 and Code 128 differ, you'll see both side by side.

#### Step 1 – Download and install the font

Download the free font from Google Fonts and install it on the computer where you edit your template. The only difference is *which* font you install:

|                                 | **Code 39**                                                                      | **Code 128**                                                                       |
| ------------------------------- | -------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| Font (bars only)                | [Libre Barcode 39](https://fonts.google.com/specimen/Libre+Barcode+39)           | [Libre Barcode 128](https://fonts.google.com/specimen/Libre+Barcode+128)           |
| Font (with readable text below) | [Libre Barcode 39 Text](https://fonts.google.com/specimen/Libre+Barcode+39+Text) | [Libre Barcode 128 Text](https://fonts.google.com/specimen/Libre+Barcode+128+Text) |

On the Google Fonts page, click **Get font → Download all**, unzip the file, and install the `.ttf` file (double-click → *Install*).

{% hint style="info" %}
Want the plain-text value shown below the barcode as well? Use the **Text** variant of either font. For bars only, use the plain variant.
{% endhint %}

#### Step 2 – Prepare the value in your monday.com column

This is the other main difference between the two codes:

|                         | **Code 39**                       | **Code 128**                                |
| ----------------------- | --------------------------------- | ------------------------------------------- |
| What goes in the column | The **plain value**, e.g. `12345` | The **pre-encoded** string, e.g. `Ì12345zÎ` |
| Extra step needed?      | No                                | **Yes** — encode the value first            |

**For Code 39:** simply enter your value in the column. Remember that only **digits, uppercase letters**, and `- . $ / + %` / space are allowed - no lowercase letters.

**For Code 128:** your column must already contain the data **including the start, stop, and checksum characters**. A font can't calculate these, so encode your text first using an **official encoder.**&#x20;

Enter your plain text, **copy** the encoded output, and paste exactly that into your monday.com column. Examples:

| Desired plain text | Exact Code 128 content of your monday.com column |
| ------------------ | ------------------------------------------------ |
| `12345`            | `Ì12345zÎ`                                       |
| `123456`           | `Ì1234560Î`                                      |
| `Hello`            | `ÌHellomÎ`                                       |
| `TEST-123`         | `ÌTEST-123&Î`                                    |
| `ABC-99`           | `ÌABC-993Î`                                      |

The first character (`Ì`) is the start character (Start B), the last (`Î`) is the stop character, and the one right before it is the calculated checksum.

{% hint style="warning" %}
&#x20;Copy the encoded string **exactly** (via copy & paste) - do **not** retype it. The control and check characters are special characters such as `Ì` or `Î`, and a single wrong character makes the code 128 unreadable.
{% endhint %}

{% hint style="info" %}
The examples above are encoded as **Code Set B** and are valid and scannable. For pure digit strings, the encoder may output an **equivalent, slightly shorter** variant (via Code Set C), both read back to the same value. Always use what the encoder gives you.
{% endhint %}

#### Step 3 – Insert the placeholder into your template

In both cases, add the placeholder for your barcode column at the desired position in your `.docx` template:

```
{{Barcode}}
```

#### Step 4 – Add start/stop characters (Code 39 only)

This is the second difference:

|                   | **Code 39**     | **Code 128**  |
| ----------------- | --------------- | ------------- |
| What you type     | `*{{Barcode}}*` | `{{Barcode}}` |
| Asterisks needed? | **Yes**         | **No**        |

**For Code 39**, place an asterisk (`*`) before and after the placeholder. Code 39 needs a defined start and stop marker so the scanner knows where the code begins and ends. The font does not add it automatically. Without the asterisks, the printed code looks like a barcode but cannot be scanned.

**For Code 128**, leave the placeholder as is. The start and stop are already part of the encoded string from your column, so no asterisks are added.

#### Step 5 – Apply the barcode font

Select the **entire** expression and set the font:

|             | **Code 39**                                | **Code 128**      |
| ----------- | ------------------------------------------ | ----------------- |
| Select this | `*{{Barcode}}*` (including both asterisks) | `{{Barcode}}`     |
| Set font to | Libre Barcode 39                           | Libre Barcode 128 |

**In your template it then looks like this:**

| **Code 39**                                                                       | **Code 128**                                                        |
| --------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
| <p><img src="/files/R4T30RloudcpvMbzCLY0" alt="" data-size="original"></p><p></p> | <img src="/files/oELBP9dmEC9pHP72tZXD" alt="" data-size="original"> |

{% hint style="success" %}
**Tip – Minimum size:** We strongly recommend a minimum font size of **36 pt** so the code scans reliably when printed (on low-resolution 203 dpi thermal/label printers, use exactly 24 or 30 pt). The more characters the code contains, the wider it becomes - long values need either a larger size or more space on the page.&#x20;

Always print and scan a test label before producing a whole batch - do this once after you've set up the template to confirm everything works, then you're good to go.
{% endhint %}

{% hint style="info" %}
**One more tip:** Leave a **quiet zone:** some empty white margin before and after the barcode. As a rule, keep at least 10× the width of the narrowest bar clear on each side; in practice, about 3–5 mm (roughly ⅛–¼ inch) of empty white space left and right is a safe minimum. If the code sits right against text or a border, the scanner can't capture it cleanly. When testing on a screen you may also run into read issues (glare, anti-aliasing) - when in doubt, print the code out briefly.
{% endhint %}

#### Step 6 – Embed the font when saving the .docx

So the barcode is generated correctly even when the font is not installed on the DocExport server, you must **embed the font in the .docx file when saving the document**. This applies to both codes.

> **help-center article "**[**Embedding a font in a .docx template**](/template/customization/custom-fonts.md)**"**

#### Step 7 – Generate the document in DocExport

Generate the document as usual via DocExport. The result now shows a **scannable barcode** in place of the placeholder, containing the value from your monday.com column.

### Download a Starter Template for Code 39 to see how it works:

{% file src="/files/QWKmqydCechO0qMclmBp" %}

***

### Quick comparison: Code 39 vs. Code 128

|                       | **Code 39**                              | **Code 128**                           |
| --------------------- | ---------------------------------------- | -------------------------------------- |
| Column content        | Plain text (e.g. `12345`)                | Pre-**encoded** text (e.g. `Ì12345zÎ`) |
| Asterisks `*` needed? | **Yes**, `*{{Barcode}}*`                 | **No**                                 |
| Encoder needed?       | No                                       | **Yes** (official encoder)             |
| Character set         | Digits, uppercase letters, a few symbols | Full ASCII incl. lowercase letters     |
| Font                  | Libre Barcode 39                         | Libre Barcode 128                      |

***

**Related articles**

* [Embedding a font in a .docx template](/template/customization/custom-fonts.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.docexport.com/template/1d-barcode.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
