What are examples of great ASCII art

Frame this beautiful ASCII art

I think everyone agrees that beautiful pictures have to be nicely framed. But most of the challenges on this page about ASCII art just want the raw image and don't care about preserving it.
Wouldn't it be nice if we had a program that had some ASCII art in it and had a nice border around it?

Write a program that uses ASCII art as input and output, and is surrounded by a nice frame.


***** *** * *** *****


╔═══════╗ ║ ***** ║ ║ *** ║ ║ * ║ ║ *** ║ ║ ***** ║ ╚═══════╝
  • You have to use exactly the same characters for the frame as in the example:
  • The top and bottom of the frame are inserted before the first and after the last line of input.
  • The left and right parts of the frame must be exactly one distance away from the widest line of the input.
  • The output may not contain leading or trailing spaces. Only one final line is allowed.
  • You can assume that the entry does not contain any unnecessary leading spaces.
  • You can assume that the input does not contain trailing spaces on any line.
  • You do not have to process empty inputs.
  • The input contains only printable ASCII characters and line breaks.
  • Function or full program allowed.
  • Standard rules for input / output.
  • Standard gaps apply.
  • This is code golf, so the lowest number of bytes wins. Tiebreaker is an earlier template.

Have fun coding!

It is highly recommended that you use some great ASCII graphics created in every challenge on this website as it is highly recommended to type into your program and display it with a nice border!


CJam, 45 characters / 52 bytes

Trying to avoid those expensive 3-byte characters was ... interesting.

Try it out online


Haskell, 139 bytes

As an example I frame the snowman "12333321".

How it works:

JavaScript (ES6), 138 bytes

This is 138 bytes in the IBM866 encoding, which is still supported in Firefox at the time of writing, but 152 bytes in UTF-8.


Example execution:

Example run from the script:

AWK, 159 bytes

Can apparently print unicode if you can figure out how to get it into the code.

(Score includes +5 for the interpreter flags)

First we find the longest line length by numerically sorting the lengths of all lines.

We set the header / footer as a repetition of the horizontal frame mark.

Then we print each line formatted to be left-justified in a field with a width between the border characters.


Pyth, 44 characters (58 bytes)


Check it out here.

This only works with the coding OEM 860. It is an extended ASCII superset used in Portuguese versions of DOS. Since I'm Portuguese (and loved making these "frames" in Pascal) and this is standard encoding, I did the following:

Here is the base64:

This answer was based on my answer at: https://codegolf.stackexchange.com/a/57883/14732 (the heavy lifting was all done there, just had to twitch a bit).



Looks less than 115 here, but the work file contains a 3-byte UTF-8 BOM signature that is incremented to 115 bytes. If you ran it in Python 3 you wouldn't need the parts list and it would come down to 112 bytes.

Golf function with dependencies; Takes entries as a zero-terminated character *

Somewhat ungolfed function in the full range



C Golf tips welcome!

We use cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content and targeted ads, to analyze our website traffic, and to understand where our visitors are coming from.

By continuing, you consent to our use of cookies and other tracking technologies and affirm you're at least 16 years old or have consent from a parent or guardian.

You can read details in our Cookie policy and Privacy policy.