Convert tags from/to filenames

Mp3tag has a variety of possibilities to convert tags and file names.
Conversion means for example getting tag information from parts of the filename or renaming files based on the information stored in the tag of an audio file.

The base concept behind all converters in Mp3tag is the so called format string, which describes an abstract pattern of a filename or a line in a tag-list file.
A format string consists of any characters and predefined placeholders or scripting functions. Every placeholder begins with the percent sign (%), followed by a tag field name and ends with the percent sign.
For example, the placeholder '%album%' stands for the field Album in the tag at all converters.

This document gives a short introduction to the converters in Mp3tag. Please also try them, Mp3tag has an unlimited undo feature in case something is not like you would have expected it :-)

Back to main page

Tag - Filename

Menu Convert > Tag - Filename

You can rename files based on the tag and file information with this converter.
The format string defines the format scheme of the new filename and all placeholders in this format string will be replaced with the information from the file when executing this converter.

Format string

The format string describes the filename scheme for the rename operation based on the tag and file information.
You can use the following placeholders:

%album% Album
%artist% Artist
%comment% Comment
%genre% Genre
%title% Title
%track% Track-Number
%year% Year
%fieldname% Any other tag field not listed here with the name 'fieldname'. Please have a look at 'View > Extended Tags...' for an overview of all available tag fields in your file.

There are also some special fields, which give you some technical information about the file:

%_bitrate% bitrate in kBit/s
%_codec% codec
%_counter% number of selected file
%_cover_mimetype% mimetype of embedded cover art
%_cover_size% size in bytes of embedded cover art
%_covers% number of embedded covers
%_directory% name of the files' directory
%_extension% file extension
%_file_create_date% creation date of file
%_file_create_datetime% creation date and time of file
%_file_create_datetime_raw% creation date and time of file in raw format
%_file_mod_date% modified date of file
%_file_mod_datetime% modified date and time of file
%_file_mod_datetime_raw% modified date and time of file in raw format
%_file_size% size of file formatted
%_file_size_bytes% size of file in bytes
%_file_size_kb% size of file in kilobytes
%_file_size_mb% size of file in megabytes
%_filename% file name without extension
%_filename_ext% file name with extension
%_folderpath% path of file without file name
%_parent_directory% name of the parent directory of the directory of the file
%_id3v2_character_encoding% character encoding of ID3v2 tag (if available)
%_length% length of file
%_length_seconds% length of file in seconds
%_mode% Mono/Stereo
%_samplerate% sample rate
%_tag% list of tag types in the file
%_tag_read% tag type that is read and displayed
%_tag_size% size of tags in file
%_tag_size_appended% size of appended tags (e.g. ID3v1) in file
%_tag_size_prepended% size of prepended tags (e.g. ID3v2) in file
%_total% total number of tracks from an album if track number has xx/xx format
%_total_files% Total number of selected files
%_vbr% VBR (variable Bitrate)
Example

%artist% - %album% - $num(%track%,2) - %title% renames to Artist - Album - 01 - Title

Notes

You can use the backslash to mark directories in the format string.

You can use the built-in Scripting functions.

Back to main page

Filename - Tag

Menu Convert > Filename - Tag

This converter takes parts from the filename and copies them to specified fields in the tag of the audio file. The format string defines the format of the filename and the placeholders are describing the way to which tag field the parts will be copied.

Format string

The format string describes the formatting scheme of the filename. The placeholders used mark the parts of the filename which are copied to the tag.
You can use the following placeholders in the format string:

%album% Album
%artist% Artist
%comment% Comment
%genre% Genre
%title% Title
%track% Track-Number
%year% Year
%dummy% this part will be ignored
%fieldname% any field with name fieldname
Example

Filename: (Artist - Album) 01 EXAMPLE Year.mp3
Format string: (%artist% - %album%) %track% EXAMPLE %year%

Notes

You can use the backslash to mark directories in the format string.

Back to main page

Text file - Tag

Menu Convert > Text file - Tag

This converter imports tag information from a text file. In this text file, each line corresponds to the tag information for one file. The format string describes the format of these lines.

Text files in Unicode format need a BOM (Byte Order Marker) to be correctly identified as Unicode files.

Filename

Filename of the text file. The tags will be imported from this file.

Format string

The format string describes the format of one line in the text file.
You can use the following placeholders in the format string:

%album% Album
%artist% Artist
%comment% Comment
%genre% Genre
%title% Title
%track% Track-Number
%year% Year
%field% Any other tag field you'd like to use.
%_filename_ext% Filename (current working directory is used as file path)
%_path% Filename with full file path
%dummy% this part will be ignored
Example

Line in file: Artist / Title / Album / Year
Format string: %artist% / %title% / %album% / %year%

Back to main page

Filename - Filename

Menu Convert > Filename - Filename

This converter is a rename tool, which renames filenames based on the filename. You can define up to nine parts of the old filename and let Mp3tag organize the parts in a new way.

Old filename pattern

This format string splits the filename in several parts. You can use the following placeholders:

%1   first part
%2   second part
...
%9   last part

New filename pattern

Format string which is a combination of the parts defined in the format string above.

Example

Old filename pattern: (%1 - %2) %3 %4 %5 (%6)
Old filename: (Artist - Album) 01 EXAMPLE 2004 (COMMENT).mp3
 
New filename pattern: %5 (%1 - %2) Example '['%6']'
New filename: 2004 (Artist - Album) Example [COMMENT].mp3

Notes

You can mark directories via the backslash within the format string. Please note that Mp3tag won't rename directories but will create new directories below the current working directory if you use backslashes within the new filename pattern.

You can use the build-in Scripting functions.

Back to main page