Step-by-step tutorial · M3U basics
How to Create an M3U Playlist File
You can create a basic M3U playlist file with any plain-text editor. An M3U file is text: it contains media locations and, in an extended playlist, optional information describing each item. This guide walks through a small demonstration file you can use to understand the format.
Use authorized media only. The sample below uses the reserved example.com domain as a placeholder. Replace it only with a media URL you own or are explicitly authorized to use. This tutorial does not provide channel lists or stream sources.
1. Open a plain-text editor
Use a plain-text editor such as Notepad on Windows, TextEdit in plain-text mode on macOS, or a code editor. Do not use a rich-text format such as .docx or formatted TextEdit documents.
2. Add the M3U header
For an extended M3U playlist, start the file with this header on the first line:
#EXTM3U
The header identifies the file as an extended M3U playlist. Keep it on its own line.
3. Create your first entry and media location
An extended entry commonly uses an #EXTINF line followed by the media location on the next line. Here is a safe, non-working placeholder example:
#EXTM3U
#EXTINF:-1 tvg-id="demo.example" tvg-name="Example Channel" group-title="Demo",Example Channel
https://example.com/stream.m3u8
#EXTINFintroduces metadata for the next item.-1is commonly used for a live or unknown-length item.tvg-id,tvg-nameandgroup-titleare optional metadata attributes used by some playlist applications; support varies.- The comma separates the metadata attributes from the display name.
- The next line is the media location. The example URL is only a placeholder.
4. Add more entries
Repeat the same two-line pattern for each additional item: one #EXTINF line and then its corresponding authorized media location. Keep each location paired with the entry directly above it.
#EXTM3U
#EXTINF:-1,First example
https://example.com/media/first.m3u8
#EXTINF:-1,Second example
https://example.com/media/second.m3u8
#EXTINF:-1,Third example
https://example.com/media/third.m3u8
This sample demonstrates the entry pattern only. The example.com addresses are placeholders and are not playable streams.
5. Save the file with the .m3u extension
Choose Save As, enter a name such as my-playlist.m3u, and select plain text if your editor asks for a file format. If you are saving UTF-8 text, use UTF-8 encoding where available. Check that your editor has not silently added an extra extension such as .txt.
- Windows (Notepad): use Save As, choose a clear filename such as
my-playlist.m3u, and select the appropriate plain-text save option. Check the resulting filename in File Explorer. - macOS (TextEdit): switch the document to plain-text mode before saving, then use the
.m3uextension. - Code editor: create a new text file and save it directly with the
.m3uextension.
If your application expects UTF-8 playlist text, save using UTF-8 encoding. A filename extension by itself does not convert the file's character encoding or guarantee that a player supports its contents.
6. Validate the playlist structure in your browser
Before using the file, inspect it for common formatting mistakes. Try the M3U Playlist Inspector online checker: paste the example or select your local .m3u file. Processing takes place in your browser tab; the file is not uploaded.
Prefer building the file through a form instead of typing every line? Open the online M3U playlist generator, add an entry name and an authorized media URL, optionally include group or TVG metadata, then download the generated playlist. You can also import an existing M3U file into the generator.
The checker can report supported structural issues such as a missing header, incomplete entries, basic #EXTINF syntax problems and duplicate locations. You can also use the Python validation tutorial if you prefer a command-line workflow.
Common mistakes to avoid
- Leaving out the
#EXTM3Uheader in an extended playlist. - Forgetting the comma that separates
#EXTINFmetadata from the display name. - Adding a new
#EXTINFbefore providing the previous entry's media location. - Saving the file as rich text or with an unintended
.txtextension. - Sharing private media URLs, tokens or credentials in public examples or support requests.
What a successful check does not mean
A structurally clean M3U file is not proof that its media URLs are reachable, that playback will work, or that you have rights to distribute or access the content. M3U Playlist Inspector does not connect to media URLs, test playback, or verify licensing. Check only files and media sources you are authorized to use.
Frequently asked questions
Can I create an M3U file without special software?
Yes. A plain-text editor is enough to create a basic M3U playlist.
Should I save it as .m3u or .m3u8?
Use the extension expected by the application that will read the file. M3U8 is commonly associated with UTF-8 encoded playlist text, but the extension alone does not guarantee protocol compatibility.
Can I create an M3U playlist from media I find online?
Only use media locations you own or are authorized to access and include. A URL being publicly reachable does not automatically grant permission to use or redistribute its content.
For more examples, see the M3U playlist examples guide. For more background, read M3U file format explained and M3U vs M3U8, or return to the online M3U checker.
Related tools: analyse an existing M3U playlist, merge multiple playlists, or convert M3U to CSV or JSON.