# Line numbers

Add line numbers to text with your choice of start, padding and separator, or strip them off again.

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

## Inputs

- `text` (required, string): The text to number, or numbered text to clean.
- `action` (optional, string, one of `add`, `remove`, default `"add"`): Add numbers or remove existing ones.
- `start` (optional, integer, default `1`, range 0..1000000000): Number given to the first line.
- `padding` (optional, string, one of `none`, `space`, `zero`, default `"none"`): Make all numbers the same width with leading spaces or zeros.
- `separator` (optional, string, default `": "`): Text placed between the number and the line. Used when adding.
- `skip_blank` (optional, boolean, default `false`): Leave blank lines without a number.

## Example 1

```json
{"input":{"text":"alpha\nbeta\ngamma"}}
```

Result:

```json
{"text":"1: alpha\n2: beta\n3: gamma","lines":3}
```

## Example 2: Zero-padded

```json
{"input":{"text":"a\nb","start":9,"padding":"zero","separator":" | "}}
```

Result:

```json
{"text":"09 | a\n10 | b","lines":2}
```

## Example 3: Removing numbers

```json
{"input":{"text":"1. alpha\n2. beta","action":"remove"}}
```

Result:

```json
{"text":"alpha\nbeta","lines":2}
```

**Which number formats does "remove" understand?** A number at the start of the line, with optional spaces before it, followed by a space, a tab or one of . : ) ] | > -

**Will "remove" delete numbers that belong to the text?** Yes, if a line starts with one. "2024 was a good year" loses its "2024". Check the result when lines can start with real numbers.
