Extract a Substring

Take a piece of text by position. The default start is 1 (the first character) and the default length is 5. Positions are counted from the start of the string. You can extract from each line separately, and you can reverse the cut slice afterwards.

This tool runs in your web browser: your files and text are processed on your device and are not uploaded to TidyKit servers. Free, no sign-up.

How to extract

1. Paste the text. 2. Set the start position and the length. 3. Turn on reverse only if you want the extracted characters flipped. 4. Copy the slice.

From `SKU-AB-1994` with start 9 and length 4 you get `1994`. The same slice with reverse on becomes `4991`. A start of 1 and length of 5 from that string is `SKU-A`.

Privacy and indexing

Positions start at 1, not 0. A start of 0 or a negative length is rejected. If the start is past the end you get an empty result; if the length runs off the end you get whatever characters remain. The text is not uploaded.

Frequently asked questions

Is the first character position 0 or 1?

1. The first character is start 1.

Is my text uploaded?

No.

Can I extract the same slice from every line of a list?

Yes. Turn on the multi-line option.

Does reverse count from the end of the string?

No. It only flips the characters after they have been cut from the start. To take the last four characters of a 12-character string, use start 9 and length 4.

More Text Tools