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
Edits run locally in your browser (audio drops auto-open 30s melody preview). Sign in anytime to save 1 cloud project free, or upgrade to Pro Producer ($49/yr) for 50 cloud projects and 60 monthly AI MIDI phrase generations.
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 save a cloud project. 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
- MIDI transpose and key changer online — shift pitch without losing tempo or drums
- 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 online — turn audio melodies into editable piano-roll notes
- 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
- MIDI merger online — combine two .mid files into one multi-track DAW project
- MIDI track splitter and channel extractor — separate .mid stems
- MIDI file checker — inspect structure, channels, tempo, and compatibility risks
- MIDI to CSV — export one row per note for a spreadsheet
- MIDI to JSON converter — 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
- MIDI to audio — render .mid notes to local stereo WAV or MP3
- Multi-track MIDI editor — edit lanes, channels, mute/solo, and notes
- MIDI prep for sheet music export — clean timing before notation import
- MIDI channel changer — remap MIDI channels 1–16 while protecting drums
- MIDI trimmer — crop .mid tick windows while preserving active tempo
- MIDI CC editor — strip stuck sustain CC64 or rescale controller curves
- MIDI to sheet music — inspect printable grand staff and numbered score
- Online MIDI sequencer — compose beats and piano-roll melodies in browser
- Chord identification from MIDI — extract bar-by-bar chords and Roman numerals
- MIDI key transposer online — shift semitones or target key with drum lock
- MIDI drum pattern maker — 16-step General MIDI Channel 10 beat sequencer
- Piano audio to MIDI transcription — turn piano recordings into editable MIDI notes and sheet music
- Guitar and bass audio to MIDI — convert single-note riffs and basslines into editable .mid
- DAW MIDI file cleaner — sanitize timing, velocity, and stuck CC64 before Ableton or FL Studio
- Online MIDI editor — edit MIDI online with piano roll, shortcuts, and local export