Audio Duration Calculator

Audio Duration Calculator by Colin Crawley
Available Space
0

Settings – Uncompressed (WAV, AIFF etc.)
Settings – Compressed (MP3, AAC etc.)
Uncompressed (WAV, AIFF etc.) 1411.2 kbps

0 Hours : 0 Minutes : 0 Seconds . 0 Milliseconds
Compressed (MP3, AAC etc.) 0 kbps

0 Hours : 0 Minutes : 0 Seconds . 0 Milliseconds

This utility calculates the duration of audio files (both uncompressed, PCM/IEEE FP audio, such as .WAV/ .W64/ .RF64, .AIFF/.AIF and also lossy compressed files such as MP3, WMA, AAC and OGG Vorbis) that will fit into your available disk space:

**N.B.** If you’re looking for a calculator to do the opposite (i.e. calculate the size of audio files from a given duration), then go here.

Enter your available disk/storage space. Calculating the duration of uncompressed files also requires the Sample Rate, Bit Depth and Channel information (but not the Bit Rate, which is automatically calculated). In addition to the available disk/storage space, calculating the duration of compressed files such as MP3 etc., requires only the Bit Rate information (in this case the Sample Rate, Bit Depth and Channel information is ignored). For compressed files encoded with CBR (Constant Bit Rate), the displayed duration should be as accurate as possible (notwithstanding variables such as header information etc- see below). For compressed files encoded with VBR (Variable Bit Rate), the displayed file size can be slightly less accurate because in this case the bit rate can vary depending on the programme material.

Note that the amount of available disk space reported by your device may vary slightly due to file allocation methods, possible differences in the amount of header information and/or the fact that some operating systems calculate hard disk space differently from others (e.g., some calculate it in binary and call 1kB 1024 bytes whilst others – and most hard drive manufacturers – calculate it in decimal and call 1kB 1000 bytes) – this calculator requires decimal input but also displays the equivalent binary value for convenience.

If you find this useful and/or have any comments or suggestions then do let me know via the comment section below (please read our website rules before posting).

Leave a Reply

Your email address will not be published. Required fields are marked *

46 responses to “Audio Duration Calculator”

  1. Bertrand Odom-Reed avatar
    Bertrand Odom-Reed

    Hi Mr. Colin Crawley,

    Thank you for this tool. Just purchased a DLZ creator for a client to do podcasts and found out it could use microSD cards up to ONLY 32 GB (sad.. Mackie). I now know I can record a 4 channel, 48 kHz, 24 bit, .WAV, for a duration of 15 Hours : 25 Minutes : 55 Seconds . 555 Milliseconds. Kudos!

    Bertrand, Podcast Producer, Multimedia Consultant

    1. Colin Crawley avatar

      Hi Bertram, Thanks for your message. Are you sure about that 32Gb SD card max limit? I ask because, having just checked Mackie’s specs, they state that the DMZ Creator can accept both microSDHC and microSDXC cards. The microSDXC (Extended Capacity) standard specifies a maximum storage capacity of 2TB. Perhaps that’s worth looking into if you need longer recording times?

  2. LoΓ―c avatar
    LoΓ―c

    Can you please add the formula you use for Audio Duration Calculator uncompressed ?

    1. Colin Crawley avatar

      Hi LoΓ―c,

      Sure, here you go (these are the underlying formulæ for both the Audio Duration and Audio File Size calculators on my website):

      File Size (bits) = Duration (seconds) * Bit Rate (bits per second)
      Duration (seconds) = File Size (bits) / Bit Rate (bits per second)
      Bit Rate (bits per second) = File Size (bits) / Duration (seconds)

  3. Shawn avatar
    Shawn

    I hope you know that the good folks at Wildlife Acoustics directed me to this tool over the phone. Since I am recording bird calls, when the technician told me about your website, I really thought he said “call and crawly.com” since that’s where my wildlife scientist brain went. Anyway, thanks for this super helpful tool!

    1. Colin Crawley avatar

      Hi Shawn,
      Thanks for your message and I’m glad you like my calculator.

      I’d actually never heard of Wildlife Acoustics prior to your email. Sounds interesting though – will have to look them up.

  4. Abhiram Rajandekar avatar
    Abhiram Rajandekar

    Great Work! Thanks a lot…
    Really helpful

  5. Andrew avatar
    Andrew

    is there a way (calculator or app) to determine the bit depth & sample rate if i have the track length and bit rate? or at lease a rule of thumb?

    seems that 16-44.1 FLACs have a bit rate of approx 700kbps yet others are about twice that. is it safe to assume those are encoded w higher bit depth and-or sample rate?

    1. Colin Crawley avatar

      Hi Andrew, I assume you’re asking about FLAC files here, since that’s what you mention. With FLAC files, there’s no need to calculate (or assume) anything since both the bit depth and sample rate of the original file are encoded into the FLAC file itself. There are many tools available that let you see this information. Some (but not all) media players display bit depth and sample rate information when you use them to open a FLAC file; for example, Strawberry Music Player (available for Windows, Linux and Mac) shows that information by default. There are also cross-platform command-line tools such as ffprobe (part of ffmpeg, which you probably already have installed) and SoX which are able to show this info.

      To show file info using ffprobe – in a command window, type: ffprobe -show_streams filename | grep -e flac -e bits_per_raw_sample
      To show file info using SoX – in a command window, type: sox --i filename

  6. Piotr avatar
    Piotr

    Very useful tool, thank you!

  7. Chad avatar

    Thank you! Both for this (which I am using to plan audio playback on some rather memory-limited hardware) as well as your other audio calculators. Super helpful, all!

    1. Colin Crawley avatar

      Hi Chad, You’re very welcome! Glad to hear you find my calculators useful.

  8. Sven avatar
    Sven

    Great tool, thank you for making it freely available!

  9. boxleyroadstudios avatar

    Just a thank you. Great utility.

    1. Colin Crawley avatar

      Thanks for your kind words. Very glad to hear you find it useful.

  10. Landon French avatar
    Landon French

    I want to upload mp3 to a site so it counts the time duration. Is there a way to do this?

    1. Colin Crawley avatar

      Hello Landon French, As far as I know, you should be able to use the Web Audio API to do that. Take a look at this method for details.

      1. Landon French avatar
        Landon French

        Thank you so much! I am using a school computer, so most things are blocked, but I will look into that!

  11. Colin Charles avatar
    Colin Charles

    Could you say How many hours of mp3 audio can a dvd hold. the audio is stereo, 128 bit rate, 14.1 kHz. Thank you

    1. Colin Crawley avatar

      Hello Colin Charles, You can easily calculate that yourself using the calculator above. Just enter the maximum capacity of your DVD in the “Disk Space (Dec)” field and 128 in the “Bit Rate (kbps)” field. The “Compressed (MP3, AAC etc.)” area below will show the result.

  12. Aleksey Ulko avatar
    Aleksey Ulko

    What happens when we zip a file? Can we calculate the size of the original file if we know the upper limit size of a zip file? What kind of variables are in play here?

    1. Colin Crawley avatar

      Hello Aleksey, I’m not sure quite what your questions have to do with the calculator on this page, but in any case my response is this: Don’t worry about it; the .zip format is great for compressing text but unsuitable for compressing audio (because it isn’t designed for that purpose), so…don’t use it to compress audio πŸ˜‰ . Instead, use a compression format that is specifically designed for audio – either a lossless format such as FLAC (for fixed point) or Wavpack (for floating point), or a lossy format such as .mp3 or Ogg Vorbis. In the case of either uncompressed audio files or any of the lossy audio compression formats you’ll then simply be able to use the calculators on this website to determine either file size or duration.

  13. Carlos avatar
    Carlos

    Could you please share the formula to calculate duration for mp3 files, knowing size and bitrate?

    1. Colin Crawley avatar

      Sure. The basic formula is: Duration (seconds) = File Size (bits) / Bit Rate (bits per second)

      See also my comments above.

      1. Mayank avatar
        Mayank

        could you please tell me how to calculate AAC audio chunks duration of having sampling rate 44100.

        1. Colin Crawley avatar

          Hi Mayank,

          You’ll need to enter the bit rate for an AAC file as it’s a lossy format (similar to Mp3). A file that is originally recorded uncompressed at a sample rate of 44100 Hz won’t remain that way after conversion to AAC. Just type the file size into the available space field and then enter the bit rate of your AAC file and the calculator will give you the duration! Bear in mind that, as with all lossy formats, the result will be approximate but probably close enough to be useful.

  14. dan avatar
    dan

    Could you please add a 32khz sample rate option? Used by various old skool samplers (and even the volca sample I think)

    1. Colin Crawley avatar

      Hi Dan,

      OK – I’ve added 32kHz as an available sample rate as per your request (both in this and in the Audio File Size Calculator)

      1. Dan avatar
        Dan

        Wondefult! Thanks very much for the super quick resopnse.

  15. Colin Crawley avatar

    By the way, you may like to know I’ve just published a new MIDI Note to Audio Frequency Calculator. Do check it out.

  16. Alex Ianu avatar
    Alex Ianu

    As I said in the comments on the other calculator, the binary conversion is off. It only multiplies (or divides, in this case) by 1.024, when it should be 1.024^x, where x is 1 for K, 2 for M, 3 for G, and so on. I think it’s calculating the duration using the binary because when I enter a value in the MB field that results in 120.375 MiB, it gives me 11:38.775 duration WAV (44.1 16bit stereo), which is the same value that I need to input in the other editor to get this binary size. However, this means that entering a value with the correct MB or GB sizes gives the wrong result (meaning longer duration than the real one) – in my case 126.222 MB (correct for 120.375 MiB) gives a too high MiB (123.26) value, and therefore a too long duration. You get a wrong result in the other converter too, which gives you a smaller file size than real. The error compounds with higher prefixes (5% in Gigs).

    1. Colin Crawley avatar

      Good catch Alex, thanks. Fixed.

  17. E D avatar
    E D

    Thanks for the very useful tool! Could you please also add 8kHz and 16kHz to the sampling rate drop-down list?

    1. Colin Crawley avatar

      Done! Thanks for your comment – glad you find the calculator useful.

  18. Allan avatar
    Allan

    Cant get any result on my android phone (or am i blind? 😎)

    1. Colin Crawley avatar

      Hmm, it works fine on android here. Make sure you have javascript enabled in your browser.

  19. Tony Woolf avatar
    Tony Woolf

    Thanks for this! But is there a minor bug? Going from disk space to duration, if I reset the form, enter units as GB, then enter 10 binary, it says 1 hour and something. If I add a decimal point and zero to make it 10.0, it reads what seems a lot more likely to be the right answer.

    1. Colin Crawley avatar

      Hi Tony, Thanks for your comment. You are correct – there was indeed a bug concerning the binary input field. I’ve fixed it by disabling binary input altogether (although the correct binary value is still displayed when you enter the amount of disk space in decimal). All calculations should now be accurate. I’ll try to find a solution which allows binary input again when I have more time.

      1. Colin Crawley avatar

        Actually, I’ve decided now not to allow binary input because a) no-one has complained about its’ absence and b) I don’t think it’s that useful these days anyway.

  20. arthurmealer avatar
    arthurmealer

    Thank you! Very helpful

  21. Colin Crawley avatar

    **Updated** Now calculates compressed (MP3 etc.) as well as uncompressed files!

  22. Colin Crawley avatar

    Thanks to everyone who contacted me requesting this – it took a while but I finally managed to find some time and…here it is! πŸ™‚ Hope it’s useful to you. Let me know what you think in the comments…