# Barcode generator

Make a Code 128, EAN-13 or UPC-A barcode as SVG, with the check digit worked out or verified for you.

- Endpoint: `POST https://setget.net/v1/tools/barcode-generate` with JSON `{"input": {...}}`
- MCP: `run_tool` with `slug` = `barcode-generate`
- Page: https://setget.net/tools/barcode-generate

## Inputs

- `text` (required, string): What to encode. Code 128 takes letters, digits and symbols; EAN-13 takes 12 or 13 digits; UPC-A takes 11 or 12.
- `format` (optional, string, one of `code128`, `ean13`, `upca`, default `"code128"`): Barcode type.
- `module_width` (optional, integer, default `2`, range 1..10): Width of the thinnest bar in pixels.
- `height` (optional, integer, default `80`, range 10..1000): Height of the bars in pixels.
- `show_text` (optional, boolean, default `true`): Print the value in readable characters under the bars.
- `foreground` (optional, string, default `"#000000"`): Bar colour: hex or a basic colour name.
- `background` (optional, string, default `"#ffffff"`): Background colour: hex, a basic colour name, or "transparent".

## Example 1: Code 128

```json
{"input":{"text":"SETGET-2026"}}
```

## Example 2: EAN-13 with the check digit added (1)

```json
{"input":{"text":"400638133393","format":"ean13"}}
```

## Example 3: UPC-A

```json
{"input":{"text":"03600029145","format":"upca","show_text":false}}
```

**Do I type the check digit?** Either way works. Leave it off and it is calculated; include it and it is verified, with the correct digit shown if yours is wrong.

**Which type should I use?** Code 128 for labels, tickets and internal stock codes. EAN-13 and UPC-A are for retail products and need a number issued by GS1.
