Skip to content
100% local

Parsons code converter

Convert a melody's shape to Parsons code (U/D/R) and back again.

Input
Output

Parsons code converter

Parsons code — also called melodic contour notation — reduces a tune to the one thing that makes it recognizable even when you forget the key or the exact notes: whether each note goes up, down, or repeats. This tool converts a melody into that code, and converts a Parsons code string back into a contour, entirely in your browser.

To encode, paste a sequence of notes separated by spaces or commas — either scientific pitch names like C4, D#4 or Eb5, or plain numbers if you already have pitch values from somewhere else. The result starts with * for the reference note, then one U, D or R per following note. To decode, paste a Parsons string such as *UUDRD and get back the relative contour as a sequence of numbers starting at 0 — the honest reconstruction of the shape, since Parsons code was never meant to store the original key or intervals.

The Direction option switches between the two and is a true swap: flipping it also moves the current output back into the input, so you can round-trip a melody. Batch mode treats every line of the input as its own melody or code string, which is useful for checking a whole list of themes (the notation librarians and tune-identification indexes such as a "musical dictionary" use) in one pass. Strict validation rejects a line that doesn't match the expected format instead of silently skipping the bad token, and the notation legend option prints the U/D/R/* key under the result as a reminder.

Everything runs locally — no melody, note list or Parsons string you paste is ever uploaded. Copy the output, download it as a .txt file, or send it straight back into the input to convert the other direction.

FAQ

What is Parsons code?
A compact way to write a melody's shape: * marks the first note, then each following note is U (higher than the previous one), D (lower) or R (repeats the same pitch). It ignores key, rhythm and exact intervals on purpose.
What note formats does the encoder accept?
Scientific pitch notation such as C4, D#4 or Eb5, or plain numbers representing relative pitch — separated by spaces, commas or semicolons. A token that matches neither is skipped unless strict validation is on.
Can I get the original melody back from a Parsons code?
Not the exact notes — Parsons code never stored them. Decoding reconstructs the relative contour as a sequence starting at 0, which shows the same shape as the original but not its key or exact intervals.
What does batch mode do?
It treats each line of the input as a separate melody (or Parsons string) and converts every line independently, so you can process a whole list at once instead of one entry at a time.
Is my melody or note list uploaded anywhere?
No. The conversion runs entirely in your browser — nothing you paste ever leaves your device.