Pattern Punch Knit

Welcome to
Pattern Punch Knit

Pattern Punch Knit is an app for designing and previewing punch cards for knitting machines. Our algorithms use mathematics to generate 24-stitch punch cards from small patterns. You design the pattern and choose the settings, and the app creates a punch card and a knit preview of your design.

  1. Create a Pattern by clicking in the grid on the left. Use the Pattern dropdown menu to set the size of the Pattern box or to modify the Pattern in various ways.
  2. A 24-stitch Punch card will be generated from your starting Pattern, using either wallpaper symmetries or a wave function collapse algorithm. Use the Punch dropdown menu to choose the mode and options.
  3. A Knit preview will be generated based on the Punch card. Use the Knit dropdown menu to change the style and colors so that you can preview what the resulting knit fabric would look like for different yarns.
Keyboard shortcuts
  • moves the pattern around.
  • SHIFT + shifts the punch card.
  • o toggles the dropdown menus.
  • b toggles box view.
  • n N m next/previous/random wallpaper pattern.

We would love to hear how you use Pattern Punch Knit and are interested in learning from your feedback and suggestions. Let us know using our feedback form.

About the math

The “wallpaper” mode takes your Pattern as a starting tile and copies it around the Punch card in different orientations according to rules based on mathematical wallpaper patterns. You can experiment with wallpaper patterns at Lauren K. Williams’ page, and read more about creating wallpaper patterns from tiles in paper on wallpaper patterns for lattice designs in the paper Wallpaper Patterns for Lattice Designs (PDF), a collaboration with Carolyn Yackel.

The “wave” mode creates a library of smaller tiles from your Pattern and uses a so-called wave function collapse algorithm to generates a 24-stich Punch card, which locally resembles parts of your Pattern. You can watch the video Superpositions, Sudoku, the Wave Function Collapse algorithm on YouTube explaining how wave function collapse algorithms, or try it yourself in the demo by Oskar Stalberg.


This app was made by Roger Antonsen ( and Laura Taalman / mathgrrl ( The app uses the following libraries and tools: P5js, Tailwind CSS, Alpine.js, and lilGUI.

Download or Share your Pattern
This is an automatically generated 1024×768 image from your knit pattern. It is now in the gallery. You can download the file by clicking on the button below, and share your pattern in social media by using the links to the right.
Download this image
Short URL to your pattern
Social Media Sharing Links
Share to Facebook
Share to Twitter


You may log in here. Be warned: This is a demo, and your data may be deleted after a while.