Standards/spotify-code
Spotify Code
Overview
A Spotify Code is the row of rounded vertical bars, led by the Spotify logo, that opens a song, album, artist, playlist or profile in the Spotify app. A person opens Search in the Spotify mobile app, taps the camera icon and points it at the code; the app then opens the linked item 56. Anyone can make one: in the app through an item's menu ("Show Spotify Code"), or in high resolution at spotifycodes.com by pasting a Spotify URI 51.
It is a proprietary symbology owned by Spotify AB, not an open standard. Spotify has published no specification; what is known about the encoding comes from Spotify's patents and from independent reverse engineering. The code does not hold the URI itself. It holds a 37-bit "media reference" that Spotify's servers map to the URI, so a code can be resolved only through Spotify 1520. Spotify's FAQ says codes "can only be read from the in-app scanner on the Spotify app" 1.
History
Patent (December 2016). Spotify AB filed European patent application 16207062.7, "Machine readable code", on 28 December 2016. The inventors named on the US filing are Keenan Cassidy, Damian Ferrai, Ludvig Strigeus, Mattias Svala, Nicklas Söderlind and Jimmy Wahlberg 15. The European patent was granted as EP3343448B1 on 19 December 2018 16. The US application (filed 28 December 2017) was published as US20180181849A1 on 28 June 2018 and granted as US10133974B2 on 20 November 2018. Continuations followed as US10922595B2, US11501126B2 and US12014230B2, the last granted on 18 June 2024 with an anticipated expiry of 28 December 2037 1518. A European divisional (EP3444755A1, published 20 February 2019), which claimed choosing the code's colour to contrast with the surrounding image, was refused with effect from 30 January 2020 17. Reverse engineer Peter Boone calls Strigeus, an early Spotify developer, "the person who invented Spotify Codes" 20.
Launch (May 2017). Spotify first trialled the feature in Australia 14. TechCrunch reported the codes on 5 May 2017 after a reader tip and added on 8 May that they were "now officially rolling out" 10. Android Police found them in Android app version 8.4.2.636 (dated 29 April), meaning the feature was switched on without a new app release, on both Android and iOS 12. The Music Network reported the worldwide rollout on 9 May 2017 14. At launch Spotify had more than 50 million paid subscribers 13, and codes could only be shown and scanned on mobile 11. TechCrunch wrote that Spotify had "taken a tip from Snapchat", whose Snapcodes had spread as profile pictures 10.
Later. In December 2017 Spotify's artist blog described artists printing codes on stickers, beer mats and scavenger-hunt cards 9. Boone published his reverse engineering in November 2020 and November 2021 1920. In 2025 Spotify ran a global billboard campaign that consisted of a Spotify Code alone 7, and it issued the current terms of use for codes, dated 9 October 2025 4.
Technical specification
What follows is marked by origin: [patent] from Spotify's patent text, [official] from Spotify's own pages, [RE] from reverse engineering, [checked] checked by Barcoder against Spotify's live image service on 6 November 2026.
Layout.
- The code has 23 bars. The first and last are always the shortest height (0) and the 12th is always the tallest (7); these 3 are reference bars, and the other 20 bars carry data [RE]1920. [checked] Images from Spotify's renderer have 23 bars, with bar 1 and bar 23 at level 0 and bar 12 at level 7 3.
- The patent describes a start marker and a stop marker that define an invisible axis, a reference mark that sets the maximum bar length, and data carried by each bar's length measured from that axis [patent]1516. Boone found that the logo's diameter equals the tallest bar's height [RE]19.
- Each bar has 8 heights (3 bits). The patent maps lengths to bits with a Gray code, so a bar misread by one step changes only one bit [patent]16. The reverse-engineered mapping from 3 bits to a level is
[0,1,3,2,7,6,4,5][RE]22. - [checked] In the SVG Spotify serves, the drawing is 400 × 100 units, bars are 6.71 units wide with fully rounded ends, and the 8 heights run from 11 to 60 units in steps of 7 3.
- [official] The logo must stay at the front "so they can be read by the scanner", and the code needs a distinct rectangle that stands out from the background 1.
Payload and error control.
| Stage | Bits | Basis |
|---|---|---|
| Media reference | 37 | patent example 15; RE 20 |
| + error-detecting check (CRC) | 8 → 45 | patent says CRC 15; RE: CRC-8, polynomial x⁸ + x² + x + 1 20 |
| Forward error correction | 45 → 60 | patent: e.g. a convolutional code, Viterbi decoding 15; RE below |
| Bars | 60 = 20 × 3 | patent 1516 |
- Convolutional code [RE]. Rate 1/2 with generator polynomials 1011011 and 1111001 (7 taps), made tail-biting by prepending the last 6 data bits, then punctured to rate 3/4 by dropping every third output bit: 90 bits become 60 2022. Boone credits the generator polynomials to a Stack Overflow user named "Doyle" 20. The patent itself says only that the forward error correction "can, for example, be a convolutional code" 20.
- Interleaving. The patent says bits are shuffled so that losing one whole bar does not wipe out consecutive bits [patent]15. Reverse engineering found the permutation takes bit
(7 × i) mod 60[RE]20. - Decoding. Per the patent, measurement uncertainty is passed to the decoder as bit probabilities and candidates that fail the checksum are discarded 15. Strigeus told Boone: "I chose to include a CRC to let the client have a way to more easily discard invalid codes without a backend roundtrip" 20.
- Capacity. 37 bits allow 2³⁷ (about 137 billion) media references. A Spotify URI has the form
spotify:<type>:<22 characters>, with 62 possible characters, far more combinations than the code could hold, which is why the code carries a short reference instead 19. - Lookup. The patent says the reference may point to an identifier in a server-side table, which saves space 15. Boone's decoder resolves a reference through an undocumented Spotify internal endpoint (
spclient.wg.spotify.com/scannable-id/id/<media_ref>), which needs a Spotify access token [RE]2321. Spotify does not document this endpoint.
Ownerless example (from Boone's published worked examples). Media reference 26560102031 is the track spotify:track:1ykrctzPhcSS9GS3aHdtMt 20. [checked] Spotify's renderer draws this track as the levels 0 6 6 0 7 6 0 2 2 3 1 7 0 7 6 4 6 1 4 7 4 1 0, and Barcoder's re-implementation of the reverse-engineered steps above produces the same 23 levels from 26560102031. The same held for two more of Boone's published references (67775490487 and 57268659651) 32021.
Generating images [official]. spotifycodes.com builds an image URL of the form https://scannables.scdn.co/uri/plain/<format>/<background hex>/<bar colour>/<size>/<Spotify URI> 2. Its form offers SVG, PNG or JPEG; any background colour; white or black bars; and widths from 320 to 1,960 px (default 640) 1. Spotify says there is no minimum size but advises testing at print size, and notes that the in-app camera does not zoom 1.
Use cases
- Sharing between friends. The original purpose: a code shown on one phone, or sent as a screenshot by text, Instagram or e-mail, opens the item on another 10115.
- Artist merchandise and gigs. Spotify's artist blog (December 2017) described Nina Nesbitt sending stickers with a code for her 2018 album to fans in 20 cities, the band Tigercub putting codes on beer mats at the suggestion of its label Alcopop Records, and Wilco using codes on the clue cards of a 10-clue scavenger hunt at its Solid Sounds Festival 9.
- Outdoor advertising. On 12 August 2025 Spotify put up a Spotify Code with no text on a billboard in Times Square, followed by 12 locations in 10 cities (including London, Paris, Mexico City, São Paulo and Toronto). Scanning it opened a playlist on Taylor Swift's profile ahead of her album The Life of a Showgirl 7.
- Exhibitions. At the 2022 New York exhibition Jean-Michel Basquiat: King Pleasure, codes placed in the rooms opened "Listen Like Basquiat" playlists 8.
- Fan-made objects. An open-source Python project generates a 3D-printable keychain that carries a scannable code: it downloads the code image from spotifycodes.com and turns the bar lengths into extrusions 25.
Limits on use [official]. Spotify's terms forbid putting a code directly on products for sale, selling codes, or implying endorsement. Codes on marketing material that Spotify approves must lead to a playlist the user owns or has permission to promote, not to a single song, album or artist. Codes may not be used for weapons, cryptocurrencies or political campaigns, among other categories, and Spotify can revoke a code at any time 4. The terms require such playlists to have at least 10 songs, while the spotifycodes.com FAQ says 20 for yearbooks 41.
Implementations
Official. Spotify generates codes in the app and through spotifycodes.com, which calls the scannables.scdn.co image service 52. The only scanner Spotify supports is the Spotify app's camera 1. Spotify's help page also says recipients "can scan it with their phone camera", which conflicts with the FAQ 51. Spotify publishes no SDK or API documentation for Spotify Codes.
Reverse-engineered.
| Repository | Language | Stars | Last push | What it does |
|---|---|---|---|---|
boonepeter/boonepeter.github.io-code (spotify-codes-part-2) |
Python | 43 | Jan 2022 | Reads bar heights from a photo, decodes them to the media reference, then queries Spotify for the URI (needs the user's own access token); encode_decode.py also encodes a media reference into bar levels 2122 |
| ricdigi/spotify_keychain_3D_model | Python | 50 | Feb 2024 | Downloads a code image from spotifycodes.com and models it as a 3D-printable keychain; it does not encode 25 |
Star counts and push dates were read from the GitHub API on 6 November 2026. The bar encoding is therefore open in practice, but no third-party tool can make a code for a URI that has none yet, because Spotify assigns the media reference on its servers 1520. Barcoder offers no playground for this reason. Boone wrote that media references let Spotify track which codes are scanned and in theory re-map them 20; Spotify's terms say it gives code users no scan-tracking information, and its FAQ says codes with attribution or tracking cannot be created 41.
Comparison
Against a QR Code. A QR code can be made and read by anyone and can hold a full URL. A Spotify Code holds only a 37-bit reference, can be read only by Spotify's app, and cannot point to a web page: Spotify's FAQ answers "No" to codes for micro-sites or pre-sale pages 115. Choose a QR code when the target is outside Spotify or the campaign needs its own scan tracking; a Spotify Code tells the viewer at a glance that it opens Spotify, and Spotify asks for a call to action such as "Scan on Spotify" because many people do not know the code 1.
Against the Intelligent Mail Barcode. Boone compares Spotify Codes to the USPS Intelligent Mail barcode, which also stores information in bars of different heights 19. In a Spotify Code each bar takes one of 8 heights measured from a centre axis 1619; the code is read only by Spotify's app, while a postal barcode is read by mail-sorting equipment.
Against other branded codes. Like Snapcode, Messenger Code and the WeChat Mini Program Code, the brand owner controls both the generator and the scanner. Unlike the circular designs of those, the Spotify Code is a linear row of bars shaped to look like a sound wave, which the patent states as a design aim 16.
Fun facts
- Codes have stayed the same for years. Bar levels Boone published in November 2020 and November 2021 for the same songs and playlists matched the images Spotify's service drew on 6 November 2026 19203.
- According to Hackaday, the code's creator commented that a second mode, with bars not centred on the axis, would store twice as many bits 24.
Status
Active. Spotify issued new terms for Spotify Codes dated 9 October 2025 4, published a how-to guide in August 2025 6, and used a code as the whole of a global billboard campaign that month 7. The help page describing how to show and scan codes carries a 2026 copyright, and the image service answered on 6 November 2026 53. Spotify's US patents on the code run to an anticipated 28 December 2037 18. Spotify has published no figures on how many codes are made or scanned.
Sources
Deployments
No country reports mention this standard by name.
Regions / aggregations not mapped to a single country
- Universal