Draw Box Around Text

Wrap your text in clean ASCII and Unicode boxes instantly.

Draw Box Around Text

This tool adds borders around your text
which is perfect for code comments, README blocks and messages that deserve emphasis.


Load an example

Or drop a text file here
1. Box style
Nine ready-made styles plus fully custom borders. Rules-only styles (Simple ASCII) skip the side walls.
2. Layout options
padding spaces inside the border
0–8 – the whitespace between each line and the side walls.
Centers every line inside the box instead of left-aligning it
3. Border title
Optional label embedded in the top border, up to 40 characters (e.g. STEP 2). Leave blank for a plain box.
Ready to draw a box around your text.

Overview:

Sometimes plain text is not enough: a comment has to say stop and read this, a README section needs a visual wall between it and its neighbors, or a quote posted in a plain-text channel deserves a frame. The trick that works everywhere – in code, terminals, chat apps, plain email, even a sticky-note file – is a box drawn from the text characters themselves.

Our "Draw Box Around Text" tool builds that frame for you: it measures your longest line, pads or centers every line toward it, and wraps the whole block in a border of your choosing – crisp Unicode lines, heavy bars, humble dashes, or a wall of stars. What looks like decoration is actually a layout you control: inner breathing room, centered or left-aligned text, and a label written directly into the top border. This tool was used to prepare every before/after example you see below, and it is handy any time something you type needs to stand out on its own – even in places that only understand plain text.


What this Tool Does?

It works in four passes. First it splits your text line by line and trims trailing spaces, keeping blank lines in place so an empty row appears inside the box. Second, it measures the widest line and pads (or, with "Center text", centers) every line to exactly that width, plus your chosen inner padding. Third, it draws the top and bottom borders by repeating the horizontal character to the full inner width – embedding your border title if you supplied one. Fourth, it fits a side-wall character to the left and right of every row so the whole block reads as one rigid rectangle.

The result is character-perfect but still plain text: every line of the box is exactly the same length, which is why the file transfers unchanged into any editor, chat message or code comment. You can paste text, upload a .txt or .rtf file, retouch the style live, and copy or download the result.


What This Tool Is Perfect For:

Highlighting blocks in code comments: Frame a warning, a TODO or the entry point of a script so a person skimming the code cannot miss it, in any language whose comments survive ASCII art.

Laying out README files: Use bordered blocks as section dividers, notice boards or result cards – Markdown ignores them harmlessly and plain-text viewers show them perfectly.

Posting emphasis in plain-text channels: Bot messages, commit summaries, changelog entries and chat broadcasts get a frame that says this part matters without a single formatting code.

Labeling sections of plain-text reports: A titled border (STEP 2, RESULTS, DO NOT EDIT) turns a wall of monospaced text into a navigable document.

Gift cards, greetings and notes: A birthday wish or a thank-you note wrapped in a frame of stars looks festive in any medium – an email, a chat message, or a card folded in half.


Features:

Nine Border Styles plus Custom Characters: Choose from Single Line ┌─┐, Double Line ╔═╗, Heavy Line ┏━┓, Rounded ╭─╮, Classic ASCII +-+, rules-only Simple ASCII ---, and the Dots, Stars and Slashes fills, where one character repeats across every border cell. The "Custom..." option accepts your own three one-character borders: the top/bottom character, the side-wall character, and the bottom corners – handy for matching a project's comment style (a hash for shell scripts, a semicolon for old BASIC, whatever fits).

Inner Padding (0–8): The padding spaces keep every line clear of the side walls, so text never touches the frame. For example, with padding 1 and this input:

Garage sale
Saturday 9 AM

the output becomes:

┌───────────────┐
│ Garage sale   │
│ Saturday 9 AM │
└───────────────┘

Centered Text: The "Center text" switch centers each line inside the box width instead of pinning them to the left wall, which turns a block of lines into an announcement. For example, centering this input with the inner padding at 0:

Game night at 8
There will be cake.

produces:

┌───────────────────┐
│  Game night at 8  │
│There will be cake.│
└───────────────────┘

Optional Title in the Top Border: Type a short label (up to 40 characters) and it is written straight into the top border, framed by the border character on each side – like the SHIP IT title in Example 4 below. The box widens automatically when the title is longer than the text, so the label always fits and never overlaps your lines.

Blank Lines Preserved: Empty lines in your input become empty rows inside the box, so a two-paragraph note keeps the gap between its paragraphs instead of being flattened into one dense block.

Upload, Copy, Download and Live Mode: Instead of pasting, upload a .txt or .rtf file (larger files are truncated at 50,000 characters). Copy the boxed result to the clipboard or download it as boxed-text.txt. With the "Live mode" switch enabled (the default), the Output updates automatically as you type or change a setting, so the frame always fits.


How to Use this Tool?

Paste or Upload Your Text: Type or paste the lines into the "Input" textarea, or upload a .txt or .rtf file. Click the "Load an example" link above the textareas to load a sample bakery announcement you can experiment with.

Pick the Border Style: Choose one of the nine built-in styles from the "Box style" dropdown – each shows its own corner characters – or select "Custom..." and supply your own three characters.

Adjust the Layout: Set how many padding spaces (0–8) should keep your text clear of the walls, switch on "Center text" if you want the lines centered, and type an optional title to embed in the top border.

Apply: With Live mode switched on (the default), the boxed output appears in the Output field automatically as you type or change a setting. You can also press the "Apply" button at any time; your Input stays intact either way.

Copy or Download: Use the "Copy" link under the output to copy the boxed text to the clipboard, or the "Download" link to save it as a file.

Clear The Text Area: Press the "Clear" button to empty both textareas and reset every setting to its default.

Ready to frame your words? Our online Draw Box Around Text tool is your best solution!


Examples

Every example below loads its own text and settings - click "Try it" and the tool does the rest.

1. Announce an opening with a single-lined box

Centered lines in a Single Line border turn three short sentences into a proper announcement card for chat or email.

Input
The Corner Bakery
Now open at 12 Flour Lane
Fresh bread daily until 3 PM
Output
┌──────────────────────────────┐
│      The Corner Bakery       │
│  Now open at 12 Flour Lane   │
│ Fresh bread daily until 3 PM │
└──────────────────────────────┘

2. Document a function summary in code comments

Classic ASCII bars survive every code editor and linter, so a function's contract can sit framed right above the code.

Input
function greet(name)
Returns a friendly string
Called by: the signup form
Since: v2.1
Output
+----------------------------+
| function greet(name)       |
| Returns a friendly string  |
| Called by: the signup form |
| Since: v2.1                |
+----------------------------+

3. Display a quote with a double-line border

A Double Line box with centered lines reads like a framed quotation – the strongest frame in the set.

Input
Talent is the spark.
Effort is the wood that keeps it burning.
Output
╔═══════════════════════════════════════════╗
║           Talent is the spark.            ║
║ Effort is the wood that keeps it burning. ║
╚═══════════════════════════════════════════╝

4. Mark release steps with a titled heavy box

The Heavy Line style plus a title embedded in the top border labels a checklist as its own section of a terminal snippet or runbook.

Input
npm run build
npm run preview
git push origin main
Output
┏━━━━━━ SHIP IT ━━━━━━━┓
┃ npm run build        ┃
┃ npm run preview      ┃
┃ git push origin main ┃
┗━━━━━━━━━━━━━━━━━━━━━━┛

FAQs

FAQ 1: What is the difference between the box styles?
Answer: All nine draw the same rectangle, only the characters change: Single Line uses thin strokes ─│ with hard corners, Double Line uses doubled strokes ═║, Heavy Line uses thick strokes ━┃, Rounded keeps thin strokes but curves the corners . Classic ASCII falls back to + - | and works everywhere including old terminals; Simple ASCII draws only a dashed band above and below your text with no side walls at all; and Dots, Stars and Slashes repeat one character across every border cell for a textured look.

FAQ 2: Why does my boxed text look ragged after pasting it somewhere else?
Answer: Because there is no "box" stored in the text box – only characters. The frame stays perfect in any monospace font: the Output field here, code editors, terminals and most plain-text file viewers. In a proportional font (many chat input boxes, web pages), the widths differ and the frame crumples.

FAQ 3: Which style should I use inside code comments?
Answer: Classic ASCII (+-+ and |), because it is 100% safe in every programming language, needs no Unicode support, and never confuses a linter or an old terminal. Unicode box-drawing looks beautiful in READMEs, HTML pages, logs and chat, but a rare toolchain may still render it as .

FAQ 4: What exactly does the border title do?
Answer: It labels the box directly on the frame. The tool writes " TITLE " into the middle of the top border (a tab-like marker, e.g. SHIP IT in Example 4), keeps at least one border character on each side of it, and widens the whole box when the title is longer than your text. The title is part of the border row only, so it never eats into your content lines.

FAQ 5: Does the width of each box line get padded or truncated?
Answer: Padded only. The tool extends every line to the widest line's length, never clips anything, and empty lines stay empty so your paragraphs keep their gaps. There is no maximum length beyond the 50,000-character limit of the textarea.

FAQ 6: Can I use the tool on a single line of text, or is it block only?
Answer: Both. A one-line box is a perfectly valid layout – a three-row card with the top border, your text and the bottom border. It suits small exclamations and reminders where a multi-line block would be overkill.

FAQ 7: Do you save the text I insert in the tool?
Answer: No, we do not save your text. All processing happens entirely in your browser and your data remains confidential. The textarea accepts up to 50,000 characters, and uploaded files larger than that are truncated.

FAQ 8: What is Live mode, and what do the "Try it" example buttons do?
Answer: Live mode is on by default: the Output updates automatically as you type or change a setting, without pressing "Apply". The "Try it" buttons in the Examples section load a ready-made scenario – input text, style, padding, centering and title – in one click; with Live mode on the result appears immediately, otherwise press "Apply".


Tools Worth Trying

TextToolz

The Ultimate Text Tools

TextToolz works seamlessly to let you convert and design your text. It is fast, reliable and secure. Trusted by thousands of users.