ForHosting KIT · Text & AI

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
Use it from WebAPIEmailTelegramApp soon
If you enter
Items
red, green, blue
Index base
0
Separator
:
You get
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.

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.

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.

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.

POSThttps://api.kit.forhosting.com/str/enumerate-with-index

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.

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"]}'
{
  "items": [
    "red",
    "green",
    "blue"
  ]
}
{
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_items10000
max_item_chars10000
max_separator_chars32
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

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.

Can indexing begin at zero or one?

Yes. Set index_base to 0 for zero-based output or 1 for one-based output.

Read the full KIT documentation →