Skip to tool

SQL Word wrap Online

Wrap long text to a fixed width.

The output updates as you type. The tool processes input in your browser.

Worked example

Choose a column width for plain text. Display width can differ for emoji and East Asian wide characters. Use PostgreSQL’s function reference to adapt the input to SQL syntax.

Width
24
Break string
"\\n"
Cut long words
false
Sample input
This is a long line that should wrap for readability.
Sample output
This is a long line that\nshould wrap for\nreadability.

Using this operation in SQL

The interactive result uses JavaScript. Check the database dialect. PostgreSQL text functions use SQL-style one-based positions and LIKE uses its own pattern syntax.

SQL reference