All Tools
Categories
Number Tools 116 XML Tools 64 Email Marketing Tools 55 Import-Export Tools 50 JSON Tools 45 Text Tools 13 Shipping Freight Tools 5 Calculator 4
About Contact Privacy

Dragon Curve Generator

Generate the dragon curve turn sequence - the paperfolding numbers 1, 1, 0, 1, 1, 0, 0, 1... with turn mapping to R and L. Choose a start index and count up to 20,000 terms, copy or download. Runs in your browser. Free.

Parameters
1 - 20,000
Fold recurrence: even positions mirror earlier terms, odd positions alternate 1, 0, 1, 0 - a single pass, exact to the last term.
Sequence

          

About Dragon Curve Generator

Fold a strip of paper once, then again and again, always folding the same way, until the strip is a compact packet. Open every crease to a right angle and the strip traces a shape that doubles its complexity with each fold - the dragon curve, discovered in 1966 by three NASA physicists doodling with paper, and named for the sinuous outline it draws. The open direction of every crease follows a fixed infinite pattern: the one-sided paperfolding sequence 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1...

Dragon Curve Generator computes the paperfolding sequence by its fold recurrence - even positions mirror earlier terms, odd positions alternate - and shows every term as a digit and as a turn: 1 means a right turn, 0 a left turn, the instructions a turtle would follow to draw the curve. Choose a start index and a count; copy or download the run as index, digit and turn rows.

Features

  • Exact fold recurrence: Terms computed from a(2n) = a(n) and alternating odds - no randomness, no rounding.
  • Digit and turn on every row: One and zero become R and L, the dragon walking directions.
  • Start anywhere: From index 1 to ten million, any run of up to 20,000 terms.
  • Turn balance stats: The right minus left tally shows the walk drifting back toward zero.
  • Copy or download: One click export of the whole run as index, digit, turn lines.
  • Reference tab: The fold-to-digits story, the turning interpretation, the fractal family.
  • Free and private: All generation runs locally - nothing is uploaded, stored or logged.

How to Use

  1. Set the start index - which term of the fold to begin with (1 to 10,000,000).
  2. Set the count - terms to generate, up to 20,000.
  3. Generate - the recurrence fills the run in one pass.
  4. Read digit and turn - 1 with R, 0 with L, on every row.
  5. Copy or download the run for plotting, teaching or further analysis.

Examples

Example 1 - The first folds. Generate 8 terms: 1, 1, 0, 1, 1, 0, 0, 1 - the creases of a strip folded three times. Walk them as trades: R, R, L, R, R, L, L, R.

Example 2 - A doubling. Generate 16 terms and compare rows 9 to 16 with rows 1 to 8. The first 8 recur mirrored inside the second 8 - the self-similarity of the fractal starts at the very beginning.

Example 3 - Manhattan walking. Generate 32 terms and plot the turns on graph paper from the grid in any direction: RLLR in the middle retraces... the path never crosses itself; the dragon tiles the plane at every stage.

Example 4 - The balance. Generate 20,000 terms and read the stats: total right turns minus left turns stays small - the walk ends far closer to a straight line than its length suggests.

Example 5 - Stretching the run. Start at index 1,000,000 and count 100 terms: the recurrence delivers the millionth fold instantly - a stretch of infinite sequence with no seed list.

Benefits

  • True sequence: The genuine paperfolding numbers, no simulation and no approximation.
  • Two readings at once: Digit and turn side by side make the paper and the turtle view one table.
  • Any stretch: Starting late in the infinite fold costs nothing extra.
  • Self-similarity visible: Blocks of powers of two show the doubling rule directly.
  • Clean export: Copy or download lines ready for plotting software or class handouts.
  • Private and free: Everything stays in the browser; nothing is uploaded or logged.

Frequently Asked Questions

What is the dragon curve?
A self-similar fractal discovered by NASA physicists in 1966 and popularized as the Heighway dragon: walk forward while turning right or left by 90 degrees according to a fixed infinite sequence of turns, and the path folds into ever-finer copies of itself.
How does paper folding make it?
Fold a strip of paper in half repeatedly, always the same way, then unfold to 90 degrees at every crease. Each crease opens as a little valley or mountain - reading those open directions left to right produces exactly the turn sequence of the dragon.
What is the sequence?
Written 1 for one fold direction and 0 for the other, it starts 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1... The same digits become right and left turns: R, R, L, R, R, L, L, R...
How is it computed here?
By the fold recurrence: the term at an even position 2n equals the term at position n, and terms at odd positions alternate 1, 0, 1, 0... forever. The generator walks this recurrence up to ten million terms, so any stretch of the infinite fold is available instantly.
How do the turned versions relate?
Reading the sequence forward walks the curve segment by segment, turning right on a 1 and left on a 0. The folded-strip reading is the same list - the creases of a real strip run exactly along the dragon path.
How long can a run be?
A run of up to 20,000 terms may start at any index from 1, and start plus count may reach ten million - the recurrence needs constant memory and a single pass.
How is the result presented?
One row per term: the index, the digit (1 or 0) and the matching turn (R or L). Rows are numbered copy or download lines, and the stats line reports the running turn balance right minus left.
Is anything stored or uploaded?
No. The recurrence runs entirely in the browser. Nothing is sent to a server, saved or logged. Copy or download the run before closing the tab.