Our Network


Coming Soon


Coming Later

substring extractor

world's simplest string tool

Free online substring extractor. Just enter your string and this utility will automatically extract a string fragment of the given length from the given position. There are no intrusive ads, popups or nonsense, just a substring extractor. Load a string – get a substring. Created for developers by developers from team Browserling.

᠎᠎᠎          Tool Options

Start and Length

Extract a substring starting
from this position.
Extract a substring of this
length.

Substring Modes

Extract a substring
from each line of text.
Reverse the extracted
substring.

What is a substring extractor?

This web application extracts a substring from a string. It cuts the characters starting from the "start" position and ends the cut when it counts "length" characters. Both "start" and "length" can be specified in the options. For example, if the string is "Penguin" and the start is 5 and the length is 2, then the extracted substring is "ui". Starting position can take both positive and negative values. For example, if in the same penguin example the start was -4, then it would mean that we should start trimming the string from the fourth character from the end, and we would get the substring "gu". Length can also be negative. The length sign indicates the cutting direction. If the sign is "+" then truncation is to the right, if the sign is "-", then it's to the left. For example, if the start is 3 and the length is -2, then we get the substring "en". It is also possible that both variables are negative. For example, the start -3 and length -4 will give the substring "engu". If you want to truncate the beginning part of the string, just leave the length field empty, or enter the "-" sign to truncate the end part of the string. To quickly get substrings of many strings, activate the "Multi-line Mode". In this case, each string on each line will get truncated. We also have an additional option that reverses characters in the output substring. Stringabulous!


Substring extractor examples

Click to try!

Extract a Substring

In this example, we extract a substring from a quote from the film The Wizard of Oz. We specify the starting position equal to 12 and indicate the length of the substring to be 10 characters long. After cutting the string, we get two words "place like" in the output.

There's no place like home.
place like
Required options
These options will be used automatically if you select this example.
Extract a substring starting
from this position.
Extract a substring of this
length.
Extract a substring
from each line of text.
Reverse the extracted
substring.

Airport Departure Table

In this example, we activate the multi-line mode to extract the flight numbers from an airline timetable. We set a negative length value, which means that the truncation will be performed in the left direction from the specified starting position. Thus, we extract 7 symbols before the 13th character.

11:40 MK 1744 Amsterdam 11:55 LF 2834 Madrid 12:00 DA 4154 Frankfurt 12:05 RT 3812 London 12:05 TY 1029 Barcelona 12:20 HR 2834 Istanbul 12:25 KL 4212 Paris
MK 1744 LF 2834 DA 4154 RT 3812 TY 1029 HR 2834 KL 4212
Required options
These options will be used automatically if you select this example.
Extract a substring starting
from this position.
Extract a substring of this
length.
Extract a substring
from each line of text.
Reverse the extracted
substring.

Country Calling Codes

In this example, we use a negative start value to extract the country calling codes from several strings. The starting position -7 means that substrings start from the seventh character from the end, which is the "+" symbol before the code. Then four characters are extracted in the right direction, which make up the country code.

Cyprus +357 CY Albania +355 AL Belarus +375 BY Iceland +354 IS Latvia +371 LV Tunisia +216 TN Taiwan +886 TW
+357 +355 +375 +354 +371 +216 +886
Required options
These options will be used automatically if you select this example.
Extract a substring starting
from this position.
Extract a substring of this
length.
Extract a substring
from each line of text.
Reverse the extracted
substring.

Visitor List

This example uses negative values for both the start and length. This makes the program cut the lines on the right side, moving the cursor to the left side. Thus, the extracted substrings are the day and month.

Caleb Blevins Sun, Jul 05 Phyllis Ayers Tue, Oct 01 David Elliott Wed, Oct 23 Basia Mosley Mon, Dec 30 Chanda Farley Tue, Mar 03 Adena Mosley Sat, Aug 10 Elvis Kramer Tue, Oct 13 Kelly Nieves Wed, Dec 04
Sun, Jul Tue, Oct Wed, Oct Mon, Dec Tue, Mar Sat, Aug Tue, Oct Wed, Dec
Required options
These options will be used automatically if you select this example.
Extract a substring starting
from this position.
Extract a substring of this
length.
Extract a substring
from each line of text.
Reverse the extracted
substring.

Extract Reversed Substring

In this example, because we have activated the "Reverse Substring" option, we extract a reversed substring from the end of each string. We start from the second position on the right (skipping the exclamation mark at the end) and moving to the beginning, we return three letters. In the output, we get reversed substrings of the words "cat", "dog", and "fox", which are "tac", "god", and "xof".

Hello, cat! Hello, dog! Hello, fox!
tac god xof
Required options
These options will be used automatically if you select this example.
Extract a substring starting
from this position.
Extract a substring of this
length.
Extract a substring
from each line of text.
Reverse the extracted
substring.

Color Names

In this example, we specify only the starting character position value and leave the length field value empty. In this case, the tool extracts all characters from the 9th position to the end of each line. As a result, cut off all hex colors and leave only the RGB codes and color names.

#FF0000 RGB(255, 0, 0) RED #FFA500 RGB(255, 165, 0) ORANGE #FFD700 RGB(255, 215, 0) GOLD #FFFF00 RGB(255, 255, 0) YELLOW #800080 RGB(128, 0, 128) PURPLE #4B0082 RGB(75, 0, 130) INDIGO #00FF00 RGB(0, 255, 0) LIME #008000 RGB(0, 128, 0) GREEN #0000FF RGB(0, 0, 255) BLUE #000080 RGB(0, 0, 128) NAVY #000000 RGB(0, 0, 0) BLACK
RGB(255, 0, 0) RED RGB(255, 165, 0) ORANGE RGB(255, 215, 0) GOLD RGB(255, 255, 0) YELLOW RGB(128, 0, 128) PURPLE RGB(75, 0, 130) INDIGO RGB(0, 255, 0) LIME RGB(0, 128, 0) GREEN RGB(0, 0, 255) BLUE RGB(0, 0, 128) NAVY RGB(0, 0, 0) BLACK
Required options
These options will be used automatically if you select this example.
Extract a substring starting
from this position.
Extract a substring of this
length.
Extract a substring
from each line of text.
Reverse the extracted
substring.

Pro tips Master online string tools

You can pass input to this tool via ?input query argument and it will automatically compute output. Here's how to type it in your browser's address bar. Click to try!

https://onlinestringtools.com/extract-substring?input=There%27s%20no%20place%20like%20home.&start=12&length=10&multi-line=false&reverse=false

All String Tools

Didn't find the tool you were looking for? Let us know what tool we are missing and we'll build it!

Quickly URL-escape a string.

Quickly URL-unescape a string.

Quickly convert a string to HTML entities.

Quickly convert HTML entities to a string.

Quickly convert a string to base64 encoding.

Quickly decode a base64-encoded string.

Quickly construct a netstring from a regular string.

Quickly decode a netstring and output its contents.

Quickly quote a string with backslashes.

Quickly un-quote a backslash-quoted string.

Quickly generate a random string.

Quickly generate a string from the given regular expression.

Quickly extract all regular expression matches from a string.

Quickly check if a string matches a regular expression.

Quickly extract a fragment of a string.

Quickly create an image from a string.

Quickly apply printf (or sprintf) on strings.

Quickly split a string into pieces.

Quickly join strings together.

Quickly filter lines that match a pattern in a multi-line string.

Quickly duplicate a string multiple times.

Quickly reverse a string.

Quickly find and replace parts of a string with a new string.

Quickly truncate a string to the given length.

Quickly left-trim and right-trim a string.

Quickly pad a string on the left side.

Quickly pad a string on the right side.

Quickly align a string to the right.

Quickly center a string.

Quickly sort a list of strings in alphabetical, alphanumerical or numerical order.

Quickly rotate a string to the left or to the right.

Quickly convert a string to ROT13.

Quickly convert a string to ROT47.

Quickly transpose a string.

Quickly fetch a part of a string.

Quickly add a prefix to a string.

Quickly add a suffix to a string.

Quickly add a pair of quotes around a string.

Quickly remove quotes around a string.

Quickly convert spaces to newlines in a string.

Quickly convert newlines to spaces in a string.

Quickly convert spaces to tabs in a string.

Quickly convert tabs to spaces in a string.

Quickly remove empty lines from a string.

Quickly remove spaces, tabs, and newlines from a string.

Quickly remove dots, commas, and other marks from a string.

Quickly calculate a string's length.

Quickly calculate the number of newlines in a string.

Quickly convert a string to a sequence of bytes.

Quickly convert a sequence of bytes to a string.

Quickly convert a string to a binary string.

Quickly convert a binary string to a string.

Quickly convert a string to an octal string.

Quickly convert an octal string to a string.

Quickly convert a string to a decimal string.

Quickly convert a decimal string to a string.

Quickly convert a string to a hexadecimal string.

Quickly convert a hexadecimal string to a string.

Quickly convert a string to ASCII codes.

Quickly convert ASCII codes to a string.

Quickly change the case of characters in a string.

Quickly convert a string to uppercase.

Quickly convert a string to lowercase.

Quickly randomize the case of each letter in a string.

Quickly invert string's case.

Quickly extract string data from a JSON data structure.

Quickly convert a string to a JSON string.

Quickly convert a JSON stringified string to a regular string.

Quickly extract all string data from a HTML page.

Quickly extract all string data from an XML document.

Quickly convert a CSV file to evenly aligned columns of space-separated strings.

Quickly convert strings to a proper CSV file.

Quickly extract all string data from a BBCode markup.

Quickly convert a string to Morse code.

Quickly convert Morse code to a string.

Quickly create a palindrome from a string.

Quickly check if a string is a palindrome.

Quickly generate all monograms of a string.

Quickly generate all digrams of a string.


Coming Soon

These string tools are on the way!
View and Edit Strings

Quickly edit a string in a browser-based editor.

Replace Multiple Strings

Replace a set of strings with a new set of strings.

Title-case a String

Convert a string to a title.

Proper-case a String

Convert a string to proper case.

Capitalize Words in a String

Convert the first letter of every word in a string to uppercase.

Justify a String

Stretch out a string and align it along the left and right margins.

Left-align a String

Align a string to the left.

Format a Multi-line String

Format and align a multi-line string.

Number of Letters in a String

Find how many letters there are in a string.

Number of Words in a String

Find how many words there are in a string.

Number of Lines in a String

Find how many lines there are in a multi-line string.

Number of Paragraphs in a String

Find how many paragraphs there are in a multi-line string.

Sort Letters in a String

Sort all letters in a string alphabetically.

Sort Words in a String

Sort all words in a string alphabetically.

Sort a Numeric String

Sort a string that contains only numbers.

Reverse Words in a String

Reverse the order of all words in a string.

Reverse Sentences in a String

Reverse the order of all sentences in a string.

String Frequency Analysis

Find most frequent letters, words and phrases in a string.

Generate a Custom String

Create a string with specific properties.

Create String Mnemonic

Generate a mnemonic for words in a string.

Create an Anagram from a String

Rearrange letters in a string and create a new string.

Number a Multi-line String

Add line numbers to a multi-line string.

Wrap a String

Wrap strings to the given line length.

Chunkify a String

Split a string into chunks of certain length.

Divide a String into Syllables

Find syllables in a string.

Shuffle Words in a String

Shuffle the order of all words in a string.

Extract Emails from a String

Find and extract all email addresses from a string.

Extract URLs from a String

Find and extract all web addresses from a string.

Zigzagify a String

Make a string go in zigzags.

Circlify a String

Make a string go in a circle.

Squarify a String

Make a string go in a square or a rectangle.

Spiralify a String

Make a string go in a spiral.

Blockify a String

Fit a string in an N-by-M block.

Extract Numbers from a String

Find and extract all numbers from a string.

Calculate String Statistics

Analyze a string's complexity, including entropy.

ROT18 a String

Quickly convert a string to ROT18.

Convert a String to Punycode

Encode a string to punycode.

Convert Punycode to a String

Decode a string from punycode.

QP-encode a String

Convert a string to quoted-printable encoding.

QP-decode a String

Convert quoted-printable encoded data to a string.

Base32-encode a String

Encode a string to base32.

Base32-decode a String

Decode a string from base32.

Base45-encode a String

Encode a string to base45.

Base45-decode a String

Decode a string from base45.

Base58-encode a String

Encode a string to base58.

Base58-decode a String

Decode a string from base58.

Base85-encode a String

Encode a string to Ascii85.

Base85-decode a String

Decode a string from Ascii85.

UTF8-encode a String

Encode a string to UTF8.

UTF8-decode a String

Decode a string from UTF8.

UTF16-encode a String

Encode a string to UTF16.

UTF16-decode a String

Decode a string from UTF16.

UTF32-encode a String

Encode a string to UTF32.

UTF32-decode a String

Decode a string from UTF32.

IDN-encode a String

Encode a string to IDN.

IDN-decode a String

Decode a string from IDN encoding.

Uuencode a String

Convert a string to Unix-to-Unix encoding.

Uudecode a String

Convert Unix-to-Unix data to a string.

Xxencode a String

Convert a string to Xxencoding.

Xxdecode a String

Convert an Xxencoded string to a regular string.

HTML-strip a String

Strip all HTML tags from a string.

Remove Accent Characters

Remove all diacritical signs from a string.

Add Accent Characters

Randomly add accent characters to letters in a string.

Delete String Symbols

Remove punctuation marks and other symbols from a string.

Delete String Characters

Remove characters from a string.

Delete String Vowels

Remove vowels from a string.

Delete String Consonants

Remove consonants from a string.

Add Duplicate Spaces

Duplicate spaces in a string so one space becomes two.

Remove Duplicate Spaces

Normalize string spacing and remove all duplicate spaces.

Diff Two Strings

Visualy compare and find differences between two strings.

String Levenshtein Distance

Calculate Levenshtein distance between two strings.

String Hamming Distance

Calculate Hamming distance between two strings.

Find LCS of Two Strings

Find the longest common subsequence of two strings.

Rewrite a String

A tiny string rewriting system.

Reduce String Alphabet

Limit the alphabet letters that are used in a string.

Generate a Zalgo String

Convert a string to Unicode mess.

Make a Zalgo String Readable

Remove Unicode mess from a string.

Generate String Typos

Create a list of all possible string typos.

Mirror a String

Generate a mirror copy of a string.

Generate Trigrams

Generate all 3-grams of a string.

Generate all N-grams

Generate all ngrams of a string.

Generate N-skip-M-grams

Generate n-skip-m-grams of a string.

Tokenize a String

Create a list of tokens from a string.

Lemmatize a String

Lemmatize all words in a string.

Stem a String

Do stemming of all words in a string.

Grep a String

Extract fragments that match a regular expression in a string.

Head a String

Split a string into fragments and extract the beginning parts.

Tail a String

Split a string into fragments and extract the ending parts.

Convert a String to Hyperstring

Create a hyperstring from a string.

Convert Hyperstring to a String

Create a regular string from a hyperstring.

Convert a String to an Array

Create an array of characters from a string.

Convert a String to Integers

Split a string into characters and return their integer values.

Replace Letters with Digits

Put digits in place of characters in a string.

Fix String Quoting

Correct misquoted strings (add/remove missing quotes).

Shift a String

Shift characters in a string to the left or right.

Color a String

Create a colorful string.

Slugify a String

Create a SEO-friendly URL from a string.

Create Mistakes in a String

Substitute random characters in a string and make errors.

Find Mistakes in a String

Run a spell checker and find mistakes in a string.

Mix Two Strings

Interleave two strings character by character.

Repeat String Characters

Duplicate characters in a string multiple times.

Generate LCD String

Draw a string on an LCD screen.

Generate a Short String

Create a string that doesn't have too many characters.

Generate a Long String

Create a string that has many characters.

Create a String of Certain Length

Generate a string with a certain amount of characters.

Generate Twin Strings

Create two strings that have the twin property.

Generate Triplet Strings

Create three strings that have the triplet property.

Create a String Cloud

Generate a word cloud from all words in a string.

Partition a String

Split a string into multiple substrings.


Subscribe!

Subscribe to our updates. We'll let you know when we release new tools, features, and organize online workshops.

Enter your email here


Feedback. We'd love to hear from you! 👋