Our Network


Coming Soon


Coming Later

string splitter

world's simplest string tool

Free online string splitter. Just load your string here and it will automatically get split into multiple substrings. You can split it by one or more characters, a regular expression, by length, or by substring count. Created for developers by developers from team Browserling.

᠎᠎᠎          Tool Options

Splitter Options

Use this split character.
(Space by default.)
Use this regular expression.
(Multiple spaces by default.)
Use this length for the pieces.
Use this number of equal parts.

Joiner Options

Use this join character in the
output (newline by default).

Substring Wrappers

Left symbol.
Right symbol.
With this option, you can
wrap the split substrings in
brackets, quotes, and other
symbols.

What is a string splitter?

This tool splits the input string into pieces. You can switch between various splitting methods – using a character, a regular expression, a fragment length, or a number of parts. If you want to split a string by a specific symbol, select the "Split by a Character" option and enter the split symbol below it (by default, it's the space symbol). If you need more advanced control of splitting, choose the "Split by a Regular Expression" option. It allows you to fine-tune the matches and extract more complex chunks. If you need to get string fragments of a certain length, then select the "Split by Length" option and specify the number of characters you want in each part. If you need to get an exact number of chunks in the output, select the "Split in Multiple Parts" option and specify the number of parts you want to obtain. By default, the substrings are output one per line but you can set any character that joins them together in the options. You can also wrap the split substrings in any characters. For example, you can enclose them in quotes (e.g., "a", "b", "c") or wrap them in brackets (e.g., [a], [b], [c]) by specifying the left and right wrappers in the options. Stringabulous!


String splitter examples

Click to try

Split a String Into Words

The given input string in this example is split by the space character into individual words. Every word is printed on its own line.

foo bar baz qux quux quuz corge grault garply waldo fred plugh xyzzy thud
foo bar baz qux quux quuz corge grault garply waldo fred plugh xyzzy thud
Required options
These options will be used automatically if you select this example.
Use this split character.
(Space by default.)
Use this join character in the
output (newline by default).
Left symbol.
Right symbol.

Split a String by a Regexp

This example splits a string into pieces by using a regular expression. The regular expression is \d+, which means "use one or more digits as separating symbols". As you can see, that's exactly what happens and the output is all substrings between the digits.

what1a2strange3example
what a strange example
Required options
These options will be used automatically if you select this example.
Use this regular expression.
(Multiple spaces by default.)
Use this join character in the
output (newline by default).
Left symbol.
Right symbol.

Split and Join by Another Symbol

Here we split the string by the "x" character and immediately join it back by the "y" character. What we effectively get is all occurrences of "x" replaced by "y".

one x two x three
one y two y three
Required options
These options will be used automatically if you select this example.
Use this split character.
(Space by default.)
Use this join character in the
output (newline by default).
Left symbol.
Right symbol.

Split a Phrase by a Length

In this example, we're splitting the input by length to get string fragments of the same width. We set the line width to 6 characters and display each substring on a new line. The last line has only two characters because the input length is not exactly divisible by 6.

Coffee in one hand. Confidence in the other.
Coffee in on e hand . Conf idence in th e othe r.
Required options
These options will be used automatically if you select this example.
Use this length for the pieces.
Use this join character in the
output (newline by default).
Left symbol.
Right symbol.

Split a String into 5 Equal Parts

In this example, we load the string "HELLO" spelled in its binary representation that consists of only ones and zeros. Since the string does not have a byte separator, it's difficult to tell where one byte ends and the next byte starts. To make it easier to understand, we split it into 5 equal parts (each part corresponds to one letter of the word "HELLO"). As a result, in the output, we get 5 space-separated bytes with 8 bits in each byte.

0100100001000101010011000100110001001111
01001000 01000101 01001100 01001100 01001111
Required options
These options will be used automatically if you select this example.
Use this number of equal parts.
Use this join character in the
output (newline by default).
Left symbol.
Right symbol.

Wrap the Substrings in Brackets

In this example, we split an idiomatic expression into words and then wrap them in square brackets. We use the regular expression-based split method and specify the regex "\s+" as the string delimiter. Once the string has been split into substrings, the symbol "[" is added before each substring and the symbol "]" is added after each substring.

The pen is mightier than the sword
[The] [pen] [is] [mightier] [than] [the] [sword]
Required options
These options will be used automatically if you select this example.
Use this regular expression.
(Multiple spaces by default.)
Use this join character in the
output (newline by default).
Left symbol.
Right symbol.

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/split-string?input=foo%20bar%20baz%20qux%20quux%20quuz%20corge%20grault%20garply%20waldo%20fred%20plugh%20xyzzy%20thud&split-by-char=true&char=%20&separator=%255Cn&symbol-before-chunk=&symbol-after-chunk=

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!
URL-encode a String

Quickly URL-escape a string.

URL-decode a String

Quickly URL-unescape a string.

HTML-encode a String

Quickly convert a string to HTML entities.

HTML-decode a String

Quickly convert HTML entities to a string.

Base64-encode a String

Quickly convert a string to base64 encoding.

Base64-decode a String

Quickly decode a base64-encoded string.

Convert a String to a Netstring

Quickly construct a netstring from a regular string.

Convert a Netstring to a String

Quickly decode a netstring and output its contents.

Slash-escape a String

Quickly quote a string with backslashes.

Slash-unescape a String

Quickly un-quote a backslash-quoted string.

Generate a Random String

Quickly generate a random string.

Generate a String from Regex

Quickly generate a string from the given regular expression.

Extract Regex Matches from a String

Quickly extract all regular expression matches from a string.

Test a String with Regex

Quickly check if a string matches a regular expression.

Extract a Substring

Quickly extract a fragment of a string.

Convert a String to an Image

Quickly create an image from a string.

Printf a String

Quickly apply printf (or sprintf) on strings.

Split a String

Quickly split a string into pieces.

Join Strings

Quickly join strings together.

Filter String Lines

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

Repeat a String

Quickly duplicate a string multiple times.

Reverse a String

Quickly reverse a string.

Find and Replace a String

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

Truncate a String

Quickly truncate a string to the given length.

Trim a String

Quickly left-trim and right-trim a string.

Left-pad a String

Quickly pad a string on the left side.

Right-pad a String

Quickly pad a string on the right side.

Right-align a String

Quickly align a string to the right.

Center a String

Quickly center a string.

Sort Strings

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

Rotate a String

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

ROT13 a String

Quickly convert a string to ROT13.

ROT47 a String

Quickly convert a string to ROT47.

Transpose a String

Quickly transpose a string.

Slice a String

Quickly fetch a part of a string.

Add a Prefix to a String

Quickly add a prefix to a string.

Add a Suffix to a String

Quickly add a suffix to a string.

Quote a String

Quickly add a pair of quotes around a string.

Unquote a String

Quickly remove quotes around a string.

Convert Spaces to Newlines

Quickly convert spaces to newlines in a string.

Convert Newlines to Spaces

Quickly convert newlines to spaces in a string.

Convert Spaces to Tabs

Quickly convert spaces to tabs in a string.

Convert Tabs to Spaces

Quickly convert tabs to spaces in a string.

Remove All Empty Lines

Quickly remove empty lines from a string.

Remove All Whitespace

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

Remove All Punctuation

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

Find the Length of a String

Quickly calculate a string's length.

Count Newlines in a String

Quickly calculate the number of newlines in a string.

Convert a String to Bytes

Quickly convert a string to a sequence of bytes.

Convert Bytes to a String

Quickly convert a sequence of bytes to a string.

Convert a String to Binary

Quickly convert a string to a binary string.

Convert Binary to a String

Quickly convert a binary string to a string.

Convert a String to Octal

Quickly convert a string to an octal string.

Convert Octal to a String

Quickly convert an octal string to a string.

Convert a String to Decimal

Quickly convert a string to a decimal string.

Convert Decimal to a String

Quickly convert a decimal string to a string.

Convert a String to Hex

Quickly convert a string to a hexadecimal string.

Convert Hex to a String

Quickly convert a hexadecimal string to a string.

Convert a String to ASCII

Quickly convert a string to ASCII codes.

Convert ASCII to a String

Quickly convert ASCII codes to a string.

Change String Case

Quickly change the case of characters in a string.

Convert a String to Uppercase

Quickly convert a string to uppercase.

Convert a String to Lowercase

Quickly convert a string to lowercase.

Randomize Letter Case in a String

Quickly randomize the case of each letter in a string.

Invert Letter Case in a String

Quickly invert string's case.

Convert JSON to a String

Quickly extract string data from a JSON data structure.

JSON Stringify a String

Quickly convert a string to a JSON string.

JSON Parse a String

Quickly convert a JSON stringified string to a regular string.

Convert HTML to a String

Quickly extract all string data from a HTML page.

Convert XML to a String

Quickly extract all string data from an XML document.

Convert CSV to a String

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

Convert a String to CSV

Quickly convert strings to a proper CSV file.

Convert BBCode to a String

Quickly extract all string data from a BBCode markup.

Convert a String to Morse Code

Quickly convert a string to Morse code.

Convert Morse Code to a String

Quickly convert Morse code to a string.

Create a Palindrome

Quickly create a palindrome from a string.

Check a Palindrome

Quickly check if a string is a palindrome.

Generate String Unigrams

Quickly generate all monograms of a string.

Generate String Bigrams

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! 👋