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
- Base64 Encoder/Decoder – Encode or decode data using Base64.
- Bcrypt – Hash strings with Bcrypt
- Text Censor – Quickly mask bad words or replace them with alternative words.
- Create palindrome – Create text that reads the same forward and backward
- Email Extractor – Extract email addresses from text
- Hidden Character Detector – Find hidden Unicode characters in text
- Join Text – Join text elements with a specified separator
- Palindrome – Check if text reads the same forward and backward
- Password Generator – Generate secure random passwords with custom options
- Text Quoter – Add quotes around text with various styles
- Randomize case – Randomize the case of letters in text
- Remove duplicate lines – Quickly delete all repeated lines from text
- Repeat Text – Repeat text multiple times
- Text Replacer – Quickly replace text in your content
- Reverse – Reverse any text character by character
- ROT13 Encoder/Decoder – Encode or decode text using ROT13 cipher.
- Rotate Text – Shift characters in text by position.
- Slug Generator – Generate URL-friendly slugs from text.
- Split – Split text into multiple parts using a separator
- Text Statistics – Get statistics about your text
- Table Text Converter – Convert tables between Markdown, CSV, HTML, MySQL, and JSON
- Compare Texts – Compare two texts and spot differences instantly
- String To morse – Quickly encode text to morse
- Truncate Text – Truncate text to a specified length
- Unicode Encoder / Decoder – Encode or decode text using Unicode escape sequences.
- Convert to Uppercase – Convert text to uppercase
- String URL decoder – Quickly URL-unescape a string.
- URL Editor – Inspect and edit URL components and query parameters.
- String URL encoder – Quickly URL-escape a string.