All Tools View Categories About Contact Privacy

Session Duration Calculator

Pair logins with logouts — get real session lengths.

Runs entirely in your browser — data never leaves this page.
0
Users
0
Sessions
0
Unmatched logins
0
Unmatched logouts

  

About Session Duration Calculator

How long do sessions really last? Access logs tell you when someone logged in and, eventually, when they logged out, but nobody reads two log lines a thousand entries apart and does the subtraction by hand. Session Duration Calculator pairs each login with its matching logout and reports per-user session counts, average, minimum and maximum durations — plus the unmatched logins and logouts that reveal when pairing broke down.

Pairing works first-in-first-out per user: each user gets their own queue, a login pushes a timestamp onto that queue, and the next logout for that same user pops the oldest pending login off it and records the gap as a completed session. This mirrors how sessions actually nest in most systems — you rarely see two logins for the same user without a logout in between, and when you do, the older one usually resolves first. Any login left in a queue with no matching logout by the end of the log is counted as an unmatched login (the user is presumably still active, or the logout never made it into the log); any logout with nothing to pair against is an unmatched logout (their session started before your log window, or something clipped it).

Start and end markers default to the words "login" and "logout", but real-world logs use all sorts of vocabulary — "authenticated", "signed in", "connection established" for starts; "disconnected", "session closed", "signed out" for ends. Both marker fields accept comma-separated lists, so you can type login, authenticated, sign in to match every phrasing your system uses in one pass, and each marker is also automatically checked against common variants like "logged in" / "sign in" without you having to spell those out.

Features

  • Automatic FIFO pairing — each login is matched to the next logout for that same user, in order.
  • Per-user statistics — session count, average, minimum and maximum duration for every user in the log.
  • Custom, multi-word markers — type your own comma-separated start/end keywords (login, authenticated, sign in…) to match whatever vocabulary your logs use.
  • Unmatched audit — logins with no logout and logouts with no login are counted separately, so broken pairs are visible, not hidden.
  • Copyable report — a full per-user breakdown as plain text, ready for a ticket or spreadsheet.

How to Use

  1. Paste auth, VPN or application session log lines — each line needs a leading timestamp, a user or account token, and a login/logout marker.
  2. Tune the start and end marker fields if your logs use different wording than "login"/"logout"; comma-separate multiple phrasings if needed.
  3. Click Calculate. Per-user session counts, average/min/max durations, and unmatched login/logout counts all appear.
  4. Copy the report to paste into a security review, capacity plan, or incident timeline.

Examples

Example 1 — VPN idle-timeout policy. Paste a day of VPN logs and see 30-minute wall-clock sessions next to multi-hour ones sitting mostly idle; use the max-duration outliers to justify enforcing (or tightening) an idle timeout.

Example 2 — Admin session review. Filter to admin accounts and check whether any session survives well past your security policy’s maximum session length, then require re-authentication for that group.

Example 3 — Diagnosing broken pairs. A high unmatched-logout count usually means log rotation or a service restart cut sessions mid-flight — the logout events exist in a file you didn’t paste, or the process crashed before logging one at all. A high unmatched-login count means sessions are still open at the end of your window, which is normal for a live tail but worth a second look on an old archive.

Example 4 — Custom vocabulary. A log that writes "user alice authenticated" and "user alice session closed" works by setting the start marker to login, authenticated and the end marker to logout, session closed — no regex knowledge required.

Benefits

  • Duration insight — see real session lengths per user instead of raw timestamp pairs.
  • Policy checks — spot session-length outliers against your security or idle-timeout policy.
  • Pair hygiene — unmatched logins/logouts flag rotation gaps, crashes, or still-open sessions.
  • Flexible vocabulary — comma-separated custom markers adapt to any log format.
  • Private — pairing and math happen entirely in your browser.

Frequently Asked Questions

What log format does it expect?
Lines with a leading timestamp (YYYY-MM-DD HH:MM:SS), a user or IP token, and a login/logout marker — e.g. 2025-06-11 08:00:00 alice login.
How are login and logout markers recognized?
Keywords like login/logged in/sign in/authenticated for starts, and logout/logged out/sign out/disconnect for ends — case-insensitive, anywhere in the line.
How are sessions paired?
First-in first-out per user: each login pairs with the next logout for that user. Unpaired logins and logouts are counted separately.
What if markers are missing?
Use the form to type your own start and end markers; parsing adapts automatically.
How are durations rounded?
To the nearest tenth of a minute; averages use exact values first.