Time and bar math
MIDI duration calculator
Open a .mid file and see its exact duration in seconds, bars, and quarter-note beats, plus every tempo point that changes the result.

Open a MIDI file
Stay on-device. Start empty if you have no file, or try a public demo.
Off-grid notes, wild velocities, leftover gaps — the dirty AI-song export producers actually get.
A clean four-bar piano phrase you can transpose, quantize, or reshape immediately.
Drums, bass, and chords on separate tracks for mute, solo, and merge practice.
The same hook after quantize and velocity cleanup — the after shot for the messy export.
Your file stays on this device unless you explicitly use Creator Cloud. After an edit, one local recovery copy is saved in this browser until you replace or clear it.
Creator Cloud
Keep the versions and extend the phrase.
Creator Cloud adds cloud history and reviewed AI MIDI edits a month. The tool you are using stays free.
- 60 reviewed AI MIDI edits each month
- 50 cloud projects with 100 versions each
- Cancel anytime; the free editor stays free
How MIDI duration is calculated
MIDI stores event positions as ticks. The file PPQ says how many ticks make a quarter note, and tempo events say how long each quarter note lasts in microseconds. EditMIDI walks the tempo map, converts the latest event tick into seconds, and reports the total.
The latest event wins, even when the last note ended earlier. A trailing marker, controller, or End of Track event can extend the measured length. That is useful for checking a file that needs to line up with a video or a fixed slot.
Bars are a reading aid, not a guarantee
The bar count uses the first time signature in the file. A 7/8 file is measured with seven eighth notes per bar, while a 4/4 file uses four quarter notes. Later meter changes are visible in the editor but are not folded into one automatic bar total.
For a song with several sections, use the tempo table and the piano roll together. The calculator gives you the whole-file number; the arrangement still decides where a bar line belongs musically.
Practical uses for the number
Use the duration to fit a cue to a video, check whether a loop is exactly two bars, estimate how much space a track needs on an album, or confirm that a generated MIDI is the length you requested. The beats field is handy when you need to convert a musical position rather than a clock time.
If the duration looks wrong, check the tempo map first. A file exported at 120 BPM but intended for 90 BPM will have the right tick positions and the wrong real-time length. The tempo changer can replace the map, but it changes playback speed without moving notes.
What the calculator cannot tell you
It does not know about audio tails, reverb, or a DAW’s count-in. It measures the MIDI timeline, not the finished recording. It also does not stretch audio or preserve vocals; those are audio-editing jobs, not MIDI tempo jobs.
The file stays local, and the report can be downloaded as JSON for a session log. Opening a file here does not change it, so you can inspect several versions and compare their lengths before choosing one.
Keep the same fileAll EditMIDI tools
Open the full index
Every page runs on the same browser MIDI engine, so you can move between them without uploading or re-importing your file.
- MIDI editor online — edit notes, tracks, and velocity in the browser
- MIDI player online — preview tracks, scrub, and loop without uploading
- Transpose MIDI online — change key without losing tempo or controllers
- Change MIDI BPM online — replace a tempo map with one steady value
- Quantize MIDI online — snap note starts and ends to a musical grid
- MIDI velocity editor — set note dynamics from 1 to 127
- MP3 to MIDI converter — turn a melody into an editable piano roll
- Audio to MIDI — sketch one melody from a local recording
- Suno MIDI cleanup — quantize and fix messy AI exports
- MIDI to MP3 — render a MIDI file to WAV or MP3 in this browser
- Piano roll viewer — see every note, pitch, and length in a .mid file
- WAV to MIDI converter — draft notes from an uncompressed recording
- Vocal to MIDI — turn a hummed or sung line into editable notes
- MIDI key finder — estimate the key, relative key, and Camelot code
- Merge MIDI files — combine two .mid files into one multi-track project
- MIDI file checker — inspect structure, channels, tempo, and compatibility risks
- MIDI to CSV — export one row per note for a spreadsheet
- MIDI to JSON — export a versioned structured note object for apps and AI
- MIDI to video — record a vertical, square, or widescreen piano-roll clip
- MIDI cover art generator — export a 1500px PNG from the note pattern
- Humanize MIDI — add bounded timing and velocity variation with a repeatable seed
- MIDI velocity curve — reshape dynamics with a gamma curve
- MIDI note length editor — make notes shorter, legato, or staccato
- MIDI to WAV — render uncompressed 44.1 or 48 kHz audio locally