Enumerate a list with indexes
Turn red, green and blue into 0: red, 1: green and 2: blue, or start at 1 for human readers. Order, repeated entries and blank ones stay exactly as they were; only the number and the separator are added. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Items
- red, green, blue
- Index base
- 0
- Separator
- :
- Enumerated
- 0: red, 1: green, 2: blue
- Text
- 0: red 1: green 2: blue
- Quantity
- 3
Enumerate List with Index turns an ordered array of strings into clear, referenceable labels. Choose whether counting begins at zero or one, provide any short separator, and receive both an array of formatted entries and a newline-joined text version. The original item order and text are preserved exactly; only the index and separator are added. This is useful when application code, documentation, review notes, prompts, or exported data need stable labels that people and systems can quote without ambiguity.
Choose the index convention that matches your audience
Start by deciding whether the first label should be zero or one. Zero-based indexing is the natural choice when the result will be compared with array positions in JavaScript, Python, or many other programming environments. It lets a displayed label correspond directly to the position a developer would use in code.
One-based indexing is usually easier for readers in instructions, agendas, checklists, survey choices, and editorial review because the first visible entry is conventionally called item one. The capability does not sort, filter, trim, or deduplicate the supplied values. It walks the array once in its existing order, which means repeated strings remain separate entries and blank strings still receive indexes.
This preservation is important when position carries meaning. If your source data is generated elsewhere, clean or reorder it before calling this operation, then treat the returned labels as a faithful positional view of that prepared list.
Use a separator that makes each label readable
The separator is inserted literally between the computed index and each original item. The default is a colon followed by a space, producing labels such as <code>0: red</code>. You can instead use a period and space for familiar numbered-list styling, a closing parenthesis for compact answer choices, a tab for downstream table processing, or a visible token such as an arrow when the output is meant for logs.
Because the string is used exactly as supplied, whitespace is significant: a colon without a trailing space produces <code>0:red</code>, while a colon with one space produces <code>0: red</code>. Empty separators are also valid when compact identifiers are desired, although a visible boundary is generally easier to interpret. Separators are limited to 32 characters to keep the operation focused on labeling rather than templating.
Item strings are never parsed for existing numbers or punctuation. If an item already begins with a number, that content remains untouched after the new index prefix, so callers should remove old labels first when replacement rather than composition is intended.
Integrate the structured and text results safely
The response includes <code>enumerated</code>, an array containing one formatted string for every input item, and <code>text</code>, the same strings joined with newline characters. Use the array when another program will map, filter, serialize, or display entries independently. Use the text form when writing a plain-text block, preparing a message, creating a prompt section, or copying the result into documentation.
The response also reports the count, selected index base, and separator, making the formatting decision explicit for auditing and debugging. Validation rejects missing or empty arrays, non-string members, unsupported index bases, oversized collections, oversized items, and overly long separators. Those checks keep malformed data from being partially transformed.
What you can do with it
Label choices for code and APIs
Create zero-based labels that correspond directly to array positions used by application logic.
Prepare readable instructions
Create one-based steps with a period, parenthesis, colon, or another separator suited to readers.
Build referenceable review lists
Give every finding or proposal a stable positional label that reviewers can cite in comments.
FAQ
What is the default separator?
The default is a colon followed by one space, producing entries such as 0: example.
Does the operation change item text or order?
No. It preserves every string and its position, adding only the index and separator prefix.
Which output form should I use?
Use enumerated for a structured array or text for the same entries joined by newline characters.
How much does a request cost?
The index base and separator do not change the price.
Should I count from 0 or from 1?
Use 0 when the labels must match positions in code, since most programming languages count from zero. Use 1 for instructions, agendas, checklists and answer choices, where people expect the first entry to be number one.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/str/enumerate-with-index \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"items":["red","green","blue"]}'const res = await fetch("https://api.kit.forhosting.com/str/enumerate-with-index", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"items": [
"red",
"green",
"blue"
]
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/str/enumerate-with-index",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"items": [
"red",
"green",
"blue"
]
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/str/enumerate-with-index", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"items":["red","green","blue"]}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"items":["red","green","blue"]}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/str/enumerate-with-index", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"items": [
"red",
"green",
"blue"
]
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "str.enumerate_with_index",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_items | 10000 |
max_item_chars | 10000 |
max_separator_chars | 32 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
The operation is deterministic, requires no network access, and costs $0.002 per API request.
Choose the index convention that matches your audience
Set <code>index_base</code> to either 0 or 1; other values are rejected so an accidental offset cannot silently produce misleading references.
Integrate the structured and text results safely
Processing is deterministic: identical JSON input always produces identical JSON output, with no timestamps, randomness, remote calls, or locale-dependent number formatting. For automated workflows, handle <code>invalid_input</code> as a correction request, fix the named field, and retry. Each API execution costs $0.002, regardless of whether zero-based or one-based labels are selected.
Technical questions
Can indexing begin at zero or one?
Yes. Set index_base to 0 for zero-based output or 1 for one-based output.