Skip to content
Tags and credits

Restore Song Tags from Filenames with Mp3tag

At a glance

Restore song metadata using Mp3tag’s Filename - Tag converter by building a format string matching your filenames. Preview results to ensure accuracy, use %dummy% as needed for unneeded fields, and always test on a small copy before running a batch update. Group similar filename patterns for best results. Adjust format strings to handle separator ambiguity and folder structures.

In this guide
  1. Why format strings matter
  2. Build a format string (step-by-step)
  3. Handle separator ambiguity
  4. Preview before save
  5. Batch workflow and safety
  6. Verification and next action

Restoring missing song tags from structured filenames in Mp3tag is highly effective as long as your files follow a consistent naming convention. This process uses the Convert → Filename - Tag function, where you define a format string that mirrors the filename or folder structure, automatically mapping parts of the name into tag fields such as %artist%, %title%, %album%, and %track%. Proper format string construction, thoughtful separator handling, thorough previews, and batch safety are essential to successful metadata recovery—and preserving your library’s integrity.

Why format strings matter

The format string is the central concept behind extracting tags from filenames. It describes exactly how information appears in your file or directory name, and each placeholder within it (like %artist% or %title%) corresponds to a tag field you want to populate. The string must match the filename structure precisely, including every symbol, space, or separator. If your string deviates from the actual filename, extracted tags will be incorrect or blank.

Whenever possible, use backslashes (\) in your format string to represent folder boundaries if you want to pull tags from folders above the file. The %dummy% placeholder is helpful when you want Mp3tag to skip certain parts of the name—such as a catalog number, an extraneous word, or a transient code—without mapping them into a tag. This level of granular control makes tag recovery from filenames both powerful and safe when used as intended.

Build a format string (step-by-step)

  1. Open Mp3tag and load files from a directory containing your target music files. Select a sample file whose naming matches the pattern you wish to use.
  2. Go to Convert → Filename - Tag. In the dialog, the filename appears, awaiting your format string.
  3. Analyze the filename and substitute repeating fragments with the corresponding placeholders. For example,
    01 - Artist - Song Title.mp3 → %track% - %artist% - %title%
    Band\[2022] Album\02. Track.mp3 → %artist%\[%year%] %album%\%track%. %title%
  4. If your filenames include literal elements—like parentheses, dots, or a keyword—make sure those are present exactly in your format string in their precise location.
  5. Click OK to preview the mapping before committing any changes.

Handle separator ambiguity

Filenames often use dashes, dots, or brackets as separators, but these characters may appear naturally in tag values as well. Separator ambiguity must be carefully managed to avoid errors in splitting tokens:

  • For literal separators (e.g., space-dash-space), use that exact sequence in your format string. If your filenames use ‘ - ’ between values, your format string must include ‘ - ’, not just ‘-’.
  • If the filename includes data you don't want in the resulting tag, use %dummy% in that position. For example, Label - 03 - Song.mp3 can be mapped with %dummy% - %track% - %title% to skip the label.
  • When part of a tag (such as the artist field) might contain the separator, try to use folder boundaries instead, or leverage unique literal patterns around the token to avoid mis-splitting. Folders can provide context that a flat filename cannot.

Example

Filename: 1999 - Smith-Jones - Live at Club.mp3
If the dash only splits fields, %year% - %artist% - %title% works. If sometimes the artist itself contains a dash (like “Smith-Jones”), this string suffices only if the filename’s dash pattern is always consistent. If patterns vary (“Smith - Jones”), you’ll need to handle such cases separately or normalize filenames first on a subset of your files.

Preview before save

  1. After inputting your format string and pressing OK, Mp3tag will show potential tag field results in its list view without applying them. This allows you to check parsing accuracy in a risk-free manner.
  2. Examine a range of filenames, focusing on edge cases: files with parentheses, multiple dashes, extra numbers, or artist names with separator-like symbols.
  3. If tag extraction is not consistent, refine your format string and repeat the preview. Do this iteratively until the preview yields the expected values for all cases present in your sample set.
  4. For libraries with filename variation, develop multiple format strings and apply them to matching selections. Avoid forcing a single string onto incompatible files—it can create faulty tags.

Batch workflow and safety

  • Begin with a small, representative subset (about 20–50 files). Working on a copy ensures you can recover from any misapplied tag conversions without risk to your main library.
  • Use Mp3tag’s filter capability to group files by filename pattern, ensuring your format string fits every selection. For guidance, read Find Missing Song Metadata with Mp3tag Filters.
  • Once you’re satisfied with preview results on your test copy, apply the conversion to your larger collection. Mp3tag only writes changes after you review and approve the proposed modifications.

Verification and next action

After saving your changes, check several updated files within Mp3tag to ensure that tag fields display as you expect. Additionally, load a few files in a different music player to confirm the tags are recognized across software. If issues are found, revert to your untouched copy, refine your format string, or divide your files into more consistent batches for separate processing.

As a practical next step, select a sample set of 20 files from your library, define a suitable format string in Convert → Filename - Tag, and use the preview to ensure field extraction is correct. Once confident, apply the process to the full set.

If you need to address specialized tag scenarios, see Edit Extended Tags Without Losing Song Credits for further best practices on complex metadata editing.