New: 36 free tools for Unreal Engine and Unity developers.Try them →

9-Slice Previewer

Set 9-slice borders on a button or panel image, preview it at any size and copy UMG Box margins for Unreal or sprite borders for Unity.

  • ✓ Free, no sign-up
  • ✓ Works for Unreal Engine & Unity
  • ✓ Runs in your browser

Image

    Drag the dashed lines, or type the borders in pixels.

      Preview

      Unreal Engine (UMG)

      Brush → Draw As: Box, Margin:

      Unity

      Sprite Editor → Border (pixels), then Image Type Sliced:

      How 9-slicing works

      Four borders cut the image into a 3 × 3 grid. When the image is drawn bigger or smaller:

      • the four corners stay the same size,
      • the top and bottom edges stretch horizontally, the left and right edges vertically,
      • the centre stretches both ways (or is left out, for a frame).

      One small texture can then make buttons, panels, tooltips and dialog boxes of any size, with crisp rounded corners and borders.

      Same borders, different units

      Unreal UMGUnity UI
      WhereBrush → Draw As Box → MarginSprite Editor → Border; Image Type Sliced
      UnitsFraction of the texture (0–1)Pixels
      Example: 16 px border on a 64 px texture0.2516
      Edges onlyDraw As BorderUntick Fill Center
      Repeat instead of stretchNot for Box brushesImage Type Tiled

      Tips for 9-slice art

      • Keep the middle plain. Gradients and patterns in the edges and centre get stretched. Put detail in the corners.
      • Make borders cover the rounded corners completely, plus a pixel or two, or the curve gets stretched.
      • Small source, big result. A 64 × 64 panel is usually plenty; the size on screen comes from the widget, not the texture.
      • Pixel art: use point (nearest) filtering and scale corners by whole numbers to keep pixels square.
      • Do not go smaller than the borders. If a widget is smaller than left + right borders, the corners have to shrink and overlap.

      FAQ

      What is 9-slicing?

      A way to scale UI images such as buttons and panels without distorting them. The image is cut into a 3 × 3 grid by four borders: the corners keep their size, the edges stretch in one direction and the centre stretches in both.

      How do I set up 9-slicing in Unreal UMG?

      In the Image or Button brush, set Draw As to Box and enter the Margin. Margins are fractions of the texture size between 0 and 1, so a 16 px border on a 64 px texture is 0.25. Draw As Border draws only the edges, without the centre.

      How do I set up 9-slicing in Unity?

      Set the texture type to Sprite (2D and UI), open the Sprite Editor and drag the green border handles or type L, T, R and B in pixels. Then set the UI Image’s Image Type to Sliced (or Tiled). For a Sprite Renderer, use Draw Mode Sliced and set the sprite’s Mesh Type to Full Rect.

      Why do my 9-slice corners look too big or blurry?

      The corners are drawn at the texture’s pixel size times the UI scale. In Unity, change Pixels Per Unit Multiplier on the Image; in Unreal, the brush Image Size and DPI scaling decide it. Blurry pixel art needs point (nearest) filtering on the texture.

      Guides for this tool

      More free tools