User Rating 0.0
Total Usage 0 times
0 chars
#2d3748
#ffffff
Preview
Is this tool helpful?

Your feedback helps us improve.

About

ASCII art loses fidelity when pasted across platforms. Character grids depend on monospace rendering, and a single font substitution collapses alignment. This tool rasterizes raw text onto an HTML Canvas at pixel-level precision, preserving every space, tab, and line break as a fixed bitmap. You control the typeface, the cell size via fontSize, foreground and background colors, and padding p in pixels. Output resolution scales at 2× device pixel ratio for retina clarity. The converter handles up to 50,000 characters and exports lossless PNG, lossy JPEG (with adjustable quality q ∈ [0.1, 1.0]), or WebP.

Approximation note: glyph metrics are measured via CanvasRenderingContext2D.measureText(), which may differ from browser text layout by ±1px on certain ligature-heavy fonts. For pixel-perfect ASCII art, use a strict monospace face such as Courier New or Consolas. Tab characters are expanded to 4 spaces internally to avoid inconsistent tab-stop widths across rendering engines.

ascii to image text to image ascii art converter text to png ascii art png convert text to picture monospace image generator

Formulas

The canvas dimensions are computed from text metrics before any pixels are drawn. Each line of input is measured individually to find the widest span.

Wcanvas = max(wline1, wline2, …, wlinen) + 2 p
Hcanvas = n fontSize lineHeight + 2 p

where wlinei = ctx.measureText(linei).width in pixels, n is total line count, p is padding in px, and lineHeight is a unitless multiplier (default 1.4).

The vertical offset for the i-th line of text:

yi = p + i fontSize lineHeight + fontSize 0.8

The 0.8 factor approximates the ascent ratio for Latin glyphs, aligning baselines correctly. For retina output, all coordinates are multiplied by the device pixel ratio dpr = 2, while CSS dimensions remain at 1×.

Reference Data

Font FamilyTypeMonospaceRecommended ForPlatform Availability
Courier NewSerif MonoYesClassic ASCII artWindows, macOS, Linux
ConsolasSans MonoYesCode & box-drawing charsWindows (bundled)
MonacoSans MonoYesCompact ASCIImacOS (bundled)
MenloSans MonoYesTerminal outputmacOS (bundled)
Liberation MonoSans MonoYesLinux default monoLinux (bundled)
Lucida ConsoleSans MonoYesLegacy Windows artWindows (bundled)
Source Code ProSans MonoYesModern ASCII, wide glyphsAdobe (free, web)
DejaVu Sans MonoSans MonoYesUnicode box-drawingLinux (bundled)
Fira CodeSans MonoYesLigature-aware artGoogle Fonts (free)
monospace (generic)SystemYesFallback safe optionAll platforms
ArialSansNoProportional text bannersAll platforms
GeorgiaSerifNoElegant text rendersAll platforms
VerdanaSansNoHigh-readability textAll platforms
Times New RomanSerifNoDocument-style outputAll platforms
ImpactSansNoBold headlines & memesWindows, macOS

Frequently Asked Questions

ASCII art depends on every character occupying the same horizontal width. If you select a proportional font like Arial, characters like "i" and "W" have different widths, breaking column alignment. Always use a monospace font (Courier New, Consolas, or the generic "monospace" option) for art that relies on spatial alignment.
The tool accepts up to 50,000 characters. Canvas dimensions are capped at 16,384 × 16,384 pixels per the HTML Canvas spec in most browsers. If your text at the chosen font size would exceed that, reduce the font size or split the art into sections. The tool warns you if the computed dimensions exceed the safe limit.
PNG is lossless and ignores the quality slider. For JPEG and WebP, quality (q) ranges from 0.1 to 1.0. At q = 1.0, JPEG files are roughly 10-15× larger than at q = 0.5 with minimal perceptual difference for text. WebP at q = 0.8 typically produces files 30-40% smaller than JPEG at the same perceptual quality. For ASCII art with flat colors, PNG is usually smallest because the compression exploits uniform regions.
Yes. Enable the "Transparent Background" toggle, which skips the fillRect step. Only PNG and WebP support alpha channels. If you export as JPEG with transparency enabled, the background defaults to white because JPEG does not support alpha.
The canvas internal resolution is doubled (width × 2, height × 2), and the drawing context is scaled by 2 using ctx.scale(2, 2). The CSS display size stays at 1×. When exported, the image file contains the full 2× resolution, producing sharp text on high-DPI screens and in print. You can disable this via the DPR toggle to get 1× output for smaller files.
Tabs are expanded to 4 spaces before rendering because Canvas fillText does not interpret tab stops. This ensures consistent spacing regardless of browser. If your art uses a different tab width, adjust the source text before pasting.