}
Validation

How to check an M3U playlist before you use it

A repeatable five-minute check for any public playlist: header, entry count, duplicate URLs and a sample test in VLC, with pass/fail thresholds.

7 min read Published Updated Editorial Team

Checking a public M3U playlist means reading the file: the header, entry counts, duplicates, attribute faults, a sample test in a player, and any expiring tokens. Check the structure first, then the shape of the list, then a handful of streams. If the file fails at the first step, the later steps will not tell you much.

What you need before you start

  • A plain-text editor. A word processor adds formatting and smart quotes when you save, so do not edit playlists in one.
  • A media player, ideally VLC. It reports per-entry failures, which is what the sample step needs.
  • An unedited copy of the file. Keep the original so a later result can be compared against it.

The playlist checker runs the structural checks in the browser and reports the line number of each finding. It never requests a stream address: cross-origin rules stop a page from reading most stream hosts, so liveness is the manual step below.

Open the playlist as plain text. The first line must be #EXTM3U, and the next line should be an #EXTINF entry. A file that starts mid-entry, with metadata and no header above it, was probably cut short during download, so its counts are unreliable.

#EXTM3U on line 1 is an HLS rule (RFC 8216, section 4.1). Plain M3U predates that document, but every player in this library expects the line, so a missing header is a defect in practice.

A byte-order mark before #EXTM3U is common in files saved on Windows. In a hex editor it appears as EF BB BF ahead of the first line, which is why some players refuse a file whose header looks correct on screen. Save as UTF-8 without a BOM.

If accented names show up as garbled characters, such as é in place of é, the file was probably saved in a legacy code page. Re-save it as UTF-8. This changes only the text encoding, not the stream addresses.

2. Compare the entry count with the claimed channel count

Count the #EXTINF lines. If a source claims 10,000 channels and the file has 3,100 entries, the claim does not match the file.

The ratio of entries to unique URLs is the more useful number. A file with 8,000 entries but only 900 distinct URLs repeats the same streams many times.

One shell line prints the repeats: grep -o '^http[^ ]*' list.m3u | sort | uniq -c | sort -rn | head. The first column is how many times each address appears.

Also check for orphaned metadata: an #EXTINF line with no address below it. It adds to the entry count but produces no channel, and it is a common result of hand editing. Subtract orphans and duplicates from the total to see what the player will actually show.

3. Look for duplicates and single-host concentration

Sort the URL lines and look for repeats. Then look at the hostnames. If most entries point at one domain, the playlist depends on one server. When that server changes its tokens or blocks your region, most channels can fail at once.

You do not need a script. Paste the address lines into a spreadsheet, split on the slash so the hostname has its own column, and sort by that column. The largest group shows the concentration. Duplicates are adjacent identical addresses once the list is sorted.

The distinction matters when a list fails. A single-host list fails as a unit, so replacing it may be the only fix. A multi-host list fails one channel at a time, so removing the dead entries is usually enough.

4. Check the attribute lines

Faults in the attributes do not stop a file from loading, so they are easy to miss. Look for four:

  • Unquoted values with spaces. group-title=News World ends at the space, so a parser reads the group as News and drops World. Quoted, it survives: group-title="News World".
  • An unclosed quote. The text after it, often the channel name, can be absorbed into the value.
  • Inconsistent group names. News, news and News are usually treated as three groups.
  • A missing tvg-id. The channel still plays, but a guide cannot match it.

None of these usually prevents playback. If you plan to keep the file, fix them. If you are only judging a source, they indicate how carefully the list was put together.

5. Sample-test in VLC

Open the playlist URL in VLC. The VLC walkthrough has the steps. Test entries from the start, middle and end of the list, not just the first few.

There are three broad outcomes. If everything plays, the source is usable. If most entries refuse to play, the source is dead, or it is blocked where you are. If some play, that is typical for a public list.

A sample is only informative if it is spread out. Ten entries from the top of the list tell you about one host and one group. A better sample is three from the start, three from the middle, three from the end, and one from another group. Note each entry's host, so you can tell "six failed" from "six failed, all on one host."

Record what the player reports, not only whether the stream played. A refusal that comes back at once is a different problem from a long wait that ends in a timeout. The status-code guide and the regional guide cover those cases in more detail.

6. Watch for tokenised URLs

If URLs contain long query strings with timestamps, signatures or a token= parameter, they may stop working after a while. This does not mean the file is broken. It means the streams depend on a time-limited credential, and refreshing the file may not restore them.

The same applies to a playlist address that contains a username, password or signature. Treat it as a credential. Do not paste it into a public forum or a third-party checker when asking why it stopped working.

7. Keep the result

Write down the date, the source, the entry count, the unique-URL count and how many of your sample entries played. A few lines in a note are enough.

Two records taken weeks apart show the trend. If the entry count stays the same while playback falls, the list is probably not being updated. If the count falls and playback holds, dead entries are being removed. That comparison is more reliable than memory when you ask whether a list is getting worse.

What a healthy result looks like

Signal Healthy Warning Reject
Header #EXTM3U on line 1 BOM present Missing
Orphaned entries None A few Many
Host concentration Many hosts One host, many paths One host, tokenised URLs
Sample playback Most entries play Some entries play Nothing plays
Metadata Consistent groups and ids Missing ids Unclosed quotes throughout

A mostly healthy file is worth adding to a player and checking again later. A warning result is worth pruning, since the entries that failed in your sample will likely keep failing. A reject is not worth the effort. If every signal looks healthy but nothing plays, check your network and player before blaming the file.

The playlist checker covers the structural checks and reports line numbers for the problems it finds. It does not test whether streams are live. The guide to what a checker can prove explains the difference.