EditSafely

Transpose a String

Flip a multi-line string's rows and columns.

Runs on your device, nothing uploaded

Try:

0 chars · 0 lines

Output

Flip a multi-line string's rows and columns.

Type or paste above to see the result here.

Example: Swap rows and columns
Pad short lines with
Transposing twice gives the original back, apart from padding.

What you paste never leaves this tab

Transpose a String is JavaScript that your browser has already downloaded, and it does the whole job on your own machine. On a normal site, the text you paste is sent to a server that can log it, cache it or keep it. Here it is read and transformed inside this tab and nowhere else.

  • No upload
  • No length limit
  • Works offline once loaded
  • Nothing stored or logged

How to use Transpose a String

  1. 1. Paste the multi-line string. Enter text arranged as several lines of equal or near-equal length into the input pane, forming a grid of rows and columns. Transpose a String flips that grid.
  2. 2. Read what the tool computes. Each character's row and column position is swapped, so the first column of the input becomes the first row of the output, exactly like transposing a matrix. Short lines are padded with spaces, or dots under More options, and trailing spaces are trimmed unless you turn that off.
  3. 3. Copy the transposed grid. Copy the resulting multi-line output, now with rows and columns swapped, and paste it wherever the rotated layout is needed.

When to use Transpose a String

Transpose a String flips the rows and columns of a multi-line block of text, treating the lines as a character grid. Use it whenever text laid out in rows would be more useful read as columns, or the reverse.

  • Converting a row-oriented table to columns. You pasted a small table where each line is a row of characters, but you actually need the data column-oriented for a different tool or layout. Transposing swaps the orientation directly.
  • Checking a matrix-style puzzle by hand. A puzzle or cipher exercise represents a grid of letters and asks you to read it by column instead of by row. Transposing the grid lets you read the columns as new rows.
  • Rotating small ASCII art. You have a small block of ASCII art or a character grid and want to see how it looks with rows and columns swapped, a quick way to rotate simple layouts.
  • Verifying a rail fence or column cipher. You are working through a classic transposition cipher exercise where flipping the character grid is a step in encoding or decoding the message.

Examples

Swap rows and columns

Input

abc
def

Output

ad
be
cf

Write a word vertically

Input

HELLO

Output

H
E
L
L
O

About the Transpose a String tool

Transpose a String runs as plain JavaScript in your browser tab, with no server behind it. Flip a multi-line string's rows and columns. Whatever you put in stays on your device from start to finish.

The tool is part of EditSafely's String Tools section, 159 single-purpose utilities built around the same idea: open the page, get the result, keep your data to yourself.

You can shape the output with 2 settings, including Pad short lines with and Trim trailing spaces, and the result refreshes the moment you change one. 2 worked examples further down the page show exactly what the tool produces for real inputs.

That local-first design has practical benefits beyond privacy. The tool keeps working on a flaky connection once the page has loaded, results are instant because nothing round-trips to a server, and it is safe to use with confidential material.

Frequently asked questions

Does Transpose a String cost anything?

Yes, it is completely free. All 2,943 tools on EditSafely work without an account, a subscription or usage limits.

Is it safe to paste sensitive or confidential data?

No data leaves your device. The whole tool is JavaScript that runs inside your browser tab, so there is no upload, no server-side processing and no log of what you did. If you disconnect from the internet after the page loads, it keeps working.

How much text can I process at once?

There is no fixed limit; your device's memory is the ceiling. Up to 10 MB the result updates as you type, after a short pause that grows with the size. Above 10 MB a Run button appears so typing stays smooth, and files open up to 50 MB. A very long result shows its first 2,000 lines on screen, while Copy and Download always include all of it.

Do I need to sign up or install anything?

Nothing to install and no account needed. Open the page in any up-to-date browser, including on a phone or tablet, and the tool is ready.

How do I use the result?

The output panel has a one-click copy button, and you can keep refining the input while you work; the result updates in place as you type.