Extract Substring

Grab part of some text — by character index (negatives count from the end) or everything between two delimiters. Runs in your browser; nothing is uploaded.

Result

About this tool

Extract Substring pulls a portion out of a piece of text, two ways:

Pick the mode from the dropdown and fill in the fields it uses. Everything runs locally in your browser via WebAssembly — your text is never uploaded.

Examples

FAQ

What happens if my start or end index is out of range?

Nothing breaks — indices are clamped to the text length. end=999 on an 11-character string just means "to the end", and if the resolved start ends up at or past the end you get an empty result rather than an error.

How do negative indices work?

Python-style: they count back from the end. On hello world, start=-5 gives world, and start=0, end=-6 gives hello. Leave the end blank to take everything from the start index to the end of the string.

Are the delimiters regular expressions?

No — they're matched as literal text, so [, </b> or " need no escaping. The tool returns every non-overlapping chunk between the pair, one per line, scanning left to right; if the pair never matches you get "No matches between the delimiters." Both delimiters are required in this mode.

Does the index count bytes or characters?

Characters (Unicode code points), never bytes — so é, or 👍 each count as one and slicing can't cut a character in half. Only multi-code-point sequences like family emoji or flag emoji occupy more than one index position.

Developer & Automation Access

Run it from the terminal

Same engine as this page, headless — via the gizza CLI:

gizza tool extract-substring "The source text…"

New to the CLI? Get gizza →

Open it by URL

Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:

https://gizza.ai/tools/extract-substring/?text=The%20source%20text%E2%80%A6&mode=index&start=0&end=5&start_delim=%5B&end_delim=%5D

Machine-readable descriptor: tool.json — title + parameters JSON Schema for agents.