Opening Hours Schema Builder

Turns lines such as Mo-Fr 09:00-17:30 into an OpeningHoursSpecification array, with split shifts, closed days and date ranges for holidays.

Use the tool

Why this tool exists

Opening hours markup is easy to get subtly wrong: day names, 24-hour times, a second shift, a closed Sunday, a closure over Christmas. You write the schedule the way you would say it, one line per rule, and the tool builds the objects and groups days with equal hours.

It follows the format in Google's local business documentation: closed all day is opens and closes 00:00, open 24 hours is 00:00 to 23:59, and seasonal hours use validFrom and validThrough. The array goes into the openingHoursSpecification property of a LocalBusiness.

How to use it

  1. Write one rule per line, for example Mo-Fr 09:00-17:30.
  2. Add split shifts after a comma: Mo 09:00-12:00,13:00-17:00.
  3. Add holidays as dates: 2026-12-25 closed, or a range with two dots.
  4. Copy the array into your LocalBusiness markup.

Frequently asked questions

Which day names work?

Mo, Tu, We, Th, Fr, Sa, Su, three-letter names and full English names, in ranges like Mo-Fr or lists like Sa,Su.

How do I show 24 hours?

Write 00:00-24:00. It is output as 00:00 to 23:59, which is what Google documents.

Can hours pass midnight?

Yes. Write Sa 18:00-03:00; it stays one specification, as in the Google example.

Where do I put the result?

Inside the LocalBusiness object under openingHoursSpecification. The LocalBusiness generator does this for you.