piapia123
en

Auto-Refresh Snippet Generator

Web

Everything runs locally in your browser — nothing is uploaded

Input
Drop a file here to load its contents
Output

Generate code that makes a page refresh itself, in six forms at once: an HTML `<meta>` tag, a JavaScript timer (optionally with a visible countdown), a server `Refresh` header, and the React / Vue equivalents. ⚠️ This tool does not refresh the page you are looking at. It only produces code. That is deliberate: a self-reloading page destroys whatever you are typing and any result already on screen; a mistyped interval (meaning 60 seconds, typing 1) turns into a request loop against this site; and a static page has nowhere to store the interval, so it would be lost on reload. ⚠️ URL validation does not guess the scheme. A full URL must start with `http://` or `https://`; a site path must start with `/`; anything else is an error. Other tools here (such as URL parsing) do prepend `https://` to a bare domain — this one does not, because this code goes into your project, and guessing the scheme means guessing your deployment. ⚠️ The minimum interval is 1 second, and below 5 seconds an extra note appears — such an interval looks like a broken page and puts needless load on the server. The `meta` form also breaks the browser back button and does not work when the page was loaded via POST; each of those is stated in the note on the relevant row.

Features

  • Six forms: `meta` tag, JS timer, JS with countdown, `Refresh` header, React, Vue
  • Never guesses the scheme: full URLs and site paths are each validated, and a mistake is an error rather than a silent fix
  • Minimum interval of 1 second (`content="0"` is an infinite reload loop), with a warning when it is too short
  • Every row carries a note explaining that form’s own pitfalls (back button, POST, timer cleanup)
  • Quotes in the URL are escaped per JS rules, so the generated code pastes cleanly
  • No network, nothing uploaded

How to use

  1. Enter the page to refresh (or a site path)
  2. Set the interval in seconds
  3. Pick an output form, or leave it on “All forms”
  4. Use the button on any row to copy that snippet

FAQ

Should I use `meta` or JavaScript?
It depends on what you care about; each has costs. `meta` is simpler and works with JavaScript disabled, but has two known problems — it breaks the browser back button (pressing back immediately reloads you forward again) and it does not apply when the page was loaded via POST. JavaScript is more controllable: it can show a countdown, do something else before reloading, and use `location.replace` to avoid piling up history entries (so back still works). The cost is depending on JavaScript. Admin dashboards and monitoring panels usually want the JS form; a simple “update itself after a while” page is fine with `meta`.
What interval is reasonable?
At least 30 seconds, preferably 60 or more. A 1–2 second interval on a real page amounts to a self-inflicted DDoS — every open tab hits your server at that rate, and a handful of users makes it visible. Browsers also throttle timers in background tabs (switching away can push `setInterval` down to roughly once a minute), so a very short interval will not run at the rate you expect once the tab is hidden. If you want “update only when something changed”, the right approach is polling a lightweight endpoint, or WebSocket/SSE, rather than reloading the whole page — a full reload re-fetches every asset on it.
Why does entering `example.com` produce an error?
Because the scheme is never guessed. `example.com/dashboard` could be `https://example.com/dashboard` or `http://…`, and this code goes into your project — guessing wrong means a redirect to the wrong place. So exactly three forms are accepted: a full URL starting with `http://` or `https://`, a site path starting with `/`, and a protocol-relative address starting with `//` (which follows the enclosing page’s scheme). Anything else errors and tells you what to add. The URL parsing tool here *does* prepend `https://` to a bare domain — but that one only parses and shows you the result, so a wrong guess costs nothing. This one emits code you deploy, which is a different thing.

Related tools