ForHosting KIT · Text & AI

Path parts splitter

Paste /home/a/file.tar.gz and get its parts: folder /home/a, file name file.tar.gz, name file.tar, extension .gz and root /. Everything is worked out from the text alone, without touching any disk. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Path
/home/a/file.tar.gz
You get
Dirname
/home/a
Basename
file.tar.gz
Stem
file.tar
Ext
.gz

Split a path string into dirname, basename, stem, extension and root. Search intent: path basename dirname extension. No network calls, no random seeds, and no server state are required for a correct answer.

Five parts from one path

Take /home/a/file.tar.gz. The folder that contains the file is /home/a, the file name is file.tar.gz, the name without its last extension is file.tar, the extension is .gz and the root is /, which also makes the path absolute. The tool returns all of these at once, so you do not have to count slashes or dots by hand, and you can reuse each part on its own, for example to rename a file while keeping its folder, or to group files by extension.

Text only, never your disk

The splitting is pure text work. The tool never opens, lists or checks your file system, so it behaves the same for a path on your computer, on a server or one that does not exist yet. Nothing is sent over the network and there are no random elements or stored state, which means the same path always produces the same parts. Note that only the last extension counts: a double extension such as .tar.gz gives .gz, with file.tar left as the name.

How it works

Split a path string into dirname, basename, stem, extension and root. Pure string parsing — never touches the filesystem. The implementation is pure JavaScript with no external services.

No network calls, no random seeds, and no server state are required for a correct answer. Failed jobs are not billed. Landings target the stated search intent with precise keywords.

Prefer explicit units and ranges over silent coercion of bad types. When a field is optional, defaults are documented in params and echoed in the output. This keeps

When to use it

Use this when your search intent matches the calculator name and you need a reproducible answer for teaching, finance ops, GIS, text tooling, or unit history work. Split a path string into dirname, basename, stem, extension and root. No network calls, no random seeds, and no server state are required for a correct answer.

Failed jobs are not billed. Landings target the stated search intent with precise keywords. Prefer explicit units and ranges over silent coercion of bad types.

When a field is optional, defaults are

Does it call the network?

No. All math and text transforms are local and deterministic.

Does it check whether the file or folder exists?

No. It analyzes the text only and never touches the file system, so it works with any path you type, even one that exists neither on your computer nor on any server.

Which extension does it report for a name like file.tar.gz?

Only the last one, .gz, leaving file.tar as the name without extension. If you need the full double extension, take it from the complete file name, which is returned as it is.

How can I tell whether a path is absolute?

The tool reports the root and whether the path is absolute. In the example, /home/a/file.tar.gz starts at the root /, so it is marked as absolute.

Does the same path always give the same parts?

Yes. There are no random elements and no stored state, so the same path produces exactly the same folder, name, extension and root every time you split it.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/text/path-parts

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/text/path-parts \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"path":"/home/a/file.tar.gz"}'
{
  "path": "/home/a/file.tar.gz"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "text.path_parts",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

The calculator is free in the browser, deterministic, and identical in the API path. Inputs are validated before any arithmetic so invalid payloads fail with invalid_input. Half-up rounding is applied once from raw IEEE results when decimals are requested. Use the same JSON contract from spreadsheets, CMS

How it works

The calculator is free in the browser, deterministic, and identical in the API path. Inputs are validated before any arithmetic so invalid payloads fail with invalid_input. Half-up rounding is applied once from raw IEEE results when decimals are requested. Use the same JSON contract from spreadsheets, CMS hooks, automation, or teaching demos.

Inputs, limits and rounding

Optional decimals use half-up once. No network calls, no random seeds, and no server state are required for a correct answer. Failed jobs are not billed. Landings target the stated search intent with precise keywords. Prefer explicit units and ranges over silent coercion of bad types. When Provide the required parameters as JSON numbers or strings as documented. Invalid types, missing required fields, or out-of-range values raise invalid_input with a clear message. Outputs echo key inputs so automation can log the full context of each call. The calculator is free in the browser, deterministic, and identical in the API path. Inputs are validated before any arithmetic so invalid payloads fail with invalid_input. Half-up rounding is applied once from raw IEEE results when decimals are requested. Use the same JSON contract from spreadsheets, CMS hooks, automation, or teaching demos.

When to use it

The calculator is free in the browser, deterministic, and identical in the API path. Inputs are validated before any arithmetic so invalid payloads fail with invalid_input. Half-up rounding is applied once from raw IEEE results when decimals are requested. Use the same JSON contract from spreadsheets, CMS hooks, automation, or teaching demos.

Quick check

Paste values in the free widget and compare with a spreadsheet.

Automation

Call the API with the same JSON contract from n8n, scripts, or CMS.

Teaching

Show the formula and pinned golden examples without proprietary software.

Is it free in the browser?

Yes. Tier A runs fully client-side with the same core as the API.

What happens on bad input?

The handler throws invalid_input; failed jobs are not billed.

Can I use it from the API?

Yes. Send the same JSON fields documented in params.

Who authors this?

Aspire (elon@forhosting.com), EN-only delivery; Nitro hydrates locales.

Read the full KIT documentation →