GenerateRandomSearch

Hitomezashi Pattern Template Generator

Hitomezashi patterns are made from nothing but straight running stitches on a square grid. Every line of the grid is stitched one on, one off, and the only choice for each line is whether it starts with a stitch or a gap. Those choices — one offset per row line and one per column line — are enough to produce the interlocking crosses, steps and meanders the patterns are known for, none of which is drawn directly. This makes the grid, works out every stitch, and prints the template at a true, measured size with a scale bar and a square you can check with a ruler before you rely on it. The offsets can be drawn at random, typed as 0s and 1s, or read from words. It is a drawing aid: it marks where stitches go and says nothing about fabric, thread or technique.

What this generator does

Computes and prints the exact stitch layout for a hitomezashi grid, at the size the stitches will be. The geometric pattern generator tiles a motif with a chosen symmetry, and the Truchet tile generator turns arcs at random; both draw shapes. Here nothing is drawn but stitches on grid lines, and the shapes emerge from the offsets — which is why the page can check every line and prove the regions two-colour.

How to use this tool

  1. Choose millimetres or inches and the stitch length — every stitch and every gap is this long.
  2. Set the cells across and down, or press Fill the paper to use the whole sheet.
  3. Choose where the offsets come from: at random, typed as 0s and 1s, or from words.
  4. Press Make the template and read the check line under the result.
  5. Print it, then measure the scale bar and square before using the template; they must be exactly the size printed beside them.
  6. Download the SVG for a cutter or drawing program, or the JSON to keep the exact offsets.

Understanding the controls

Units and stitch length
Millimetres or inches. Every stitch and every gap is one stitch length long, so a 10 mm length gives stitches and gaps of 10 mm; the whole template is cells times that, plus the border on each side.
Cells across and down
A grid of cells has one more line than cells in each direction, and each line gets its own offset. The hints say the most that fit the chosen paper with room left for the heading and the scale check; Fill the paper sets both.
Where the offsets come from
At random draws each line's offset. Typed takes 0s and 1s and repeats them to fill. From words reads each letter as a vowel (1) or consonant (0), ignoring accents, spaces and punctuation; Y counts as a consonant. All lines starting with a stitch gives the plain, regular grid of crosses.
Mark the grid points
Small dots at every grid corner, for transferring the grid or keeping stitches straight. The stitches are drawn slightly short of the dots so a stitch's ends are visible.
Shade the regions in two colours
Fills the shapes the stitches enclose, alternating two colours. It always works with two: regions that share a stitched edge always get different colours, and the page checks that on every template.
Seed (optional)
With random offsets, the same seed and grid size give the same offsets again while the generator is unchanged. The seed is for reproducing a template and is not cryptographic.

Worked examples

16 by 20 cells, 10 mm stitches, 5 mm border, random offsets — seed indigo
Row offsets 100011101110110010001, column offsets 00001011110111100. 338 stitches enclose 38 regions, and the template is 170 by 210 mm.
The same grid with every line starting on a stitch
Still 338 stitches, now enclosing 81 regions: the regular grid of small crosses that every offset pattern departs from.
From the words 'needle and thread' for rows and 'running stitch' for columns
Row offsets 011001100000110011001, column offsets 01001000010000100 — 43 regions. The same words always give the same template.

Common use cases

  • A practice grid for a first piece of running-stitch embroidery, sized to a coaster or a cushion panel
  • A maths lesson on binary choices, where a class turns their names into offsets and compares the patterns
  • Drawing or colouring sheets in which the regions really do colour in two colours
  • A true-to-size SVG to send to a cutting machine or a pen plotter

How this generator works

Each horizontal line has an offset of 0 or 1, and so does each vertical line. On a line with offset 0 the first unit is a stitch, the second a gap, the third a stitch, and so on; with offset 1 it starts with a gap. That rule is applied to every line and every stitch is listed by its line and position. The template is drawn from that list as an SVG whose width and height are stated in millimetres, so a viewer that respects units shows it at true size, and the print sheet places it on the paper at that size inside the margin you chose. The stitch list alone is then checked. One pass reads every line back and confirms the stitches and gaps alternate one unit at a time, starting where the offset says, with no stitch missing or doubled. Another walks from cell to cell, keeping a colour across an open edge and switching it across a stitched one; if any cell were reached with both colours the regions could not be two-coloured. None ever has been — two-colourability follows from the alternating rule — and the check runs regardless. The stitch count follows from the grid alone when the line lengths are even: every 16-unit line has 8 stitches whichever way it starts.

Randomness and fairness

Only the offsets can be random, one draw of 0 or 1 per line; the stitches, the regions and the colouring follow from them exactly. Words and typed bits involve no randomness at all. Random offsets come from your browser's cryptographic random source, or a repeatable sequence when a seed is typed.

For how randomness is produced across the whole site, see how Generate Random works.

Assumptions this tool makes

  • The grid is square: the stitch length is the same across and down.
  • A stitch and the gap after it are the same length, which is the plainest form of hitomezashi; patterns with uneven stitch and gap lengths are not drawn.
  • Printing is at 100% scale. Any 'fit to page' or 'shrink' setting in the print dialog changes every length, which is what the scale check is there to catch.

Limitations and good to know

  • Hitomezashi only: the straight-line, one-on-one-off grid. Other sashiko patterns — curved, diagonal or layered designs — are not generated, and nothing here is offered as a historical or traditional design.
  • It is a template on paper. It does not say how to transfer it to fabric, which fabric or thread to use, or how the stitches will look sewn; none of that has been tried here.
  • The grid is at most 80 by 80 cells and must fit on one sheet of the chosen paper; larger pieces need the SVG tiled in another program.
  • True size depends on the printer honouring 100% scale and on the SVG being opened by a program that respects millimetre units.

Common mistakes

Using the template without measuring the scale bar
Measure the bar and the square with a ruler first. If they are not exactly the stated size, print again at 100% or 'actual size'.
Choosing a stitch length the paper cannot hold
The page refuses grids that do not fit and says the most that do. Shorten the stitch, reduce the cells or turn the paper sideways.

Practical tips

  • Stitch all the horizontal lines first, then all the vertical ones; the shapes only appear once both directions are in.
  • Keep the offsets with the work — the copy button gives them as two strings of 0s and 1s — so a matching piece can be made later.
  • For a class activity, give each pupil the same grid size so the patterns from their names can be laid side by side.

Privacy and your data

The template is made in your browser. Words or digits typed for the offsets, and any seed, are not stored or sent anywhere; usage counts record only that a template was made and how many stitches it had.

Frequently asked questions

Why does every line alternate?
That is the defining rule of hitomezashi: each line is a single running stitch of equal stitches and gaps. The only freedom is where each line starts, and the patterns come from how neighbouring lines' starts line up.
Why can the shapes always be coloured in two colours?
Because crossing a line of alternating stitches flips the colour in a way that always agrees around every grid corner: the four edges meeting at a corner always include an even number of stitches. The page checks it on every template anyway, cell by cell.
Can I use my own name for the pattern?
Yes — choose From words. Each letter becomes a 1 if it is a vowel and a 0 otherwise, read in order and repeated to fill the lines. Accented letters count as their plain letter; digits and symbols are skipped.
Will the SVG open at the right size?
Its width and height are written in millimetres, so programs that respect units — most vector editors and cutting software — open it at true size. Check by measuring a stitch: it should be exactly the length you chose.