Practical problem solving

Connect a tool’s result to the next task

A successful conversion is only one step. Follow three synthetic cases to review output and carry it into the next task. Tool output and separately executed validation are identified explicitly below.

Case A

Inspect an order response, then review its types and schema

An order response mixes long string IDs, null coupons and a retryable field present on only one order. Making it readable and checking its runtime contract are different tasks. Carry the full nested response into a schema, then test what it accepts.

Use JSON Formatter and JSON to TS/Zod. Set the root name to OrderBatch and leave All Optional off. Step 3 runs separately in Node/Zod; the web converter does not execute schemas.

1. Parse the response and inspect its structure

Paste the input into Formatter and select Format. Check that order IDs remain quoted strings, coupon retains null, and the missing retryable field is not invented.

JSON Formatter →

Step input or application code

{"requestId":"case-42","orders":[{"id":"9007199254740995","total":12900,"coupon":null},{"id":"9007199254740996","total":0,"coupon":"WELCOME","retryable":false}]}

Execution result or applied output

{
  "requestId": "case-42",
  "orders": [
    {
      "id": "9007199254740995",
      "total": 12900,
      "coupon": null
    },
    {
      "id": "9007199254740996",
      "total": 0,
      "coupon": "WELCOME",
      "retryable": false
    }
  ]
}

The output uses two-space indentation and preserves field order and string IDs. Compare it below, then use the TS/Zod transfer button on the current valid result. After editing input, process it again.

2. Transfer the complete response and compare the Type tab

Use Formatter’s TS/Zod button. The formatted JSON is handed over and removed from tab storage after reading. Change the root name to OrderBatch and select TS Type. If opening the converter directly, paste the formatted input below.

JSON to TS/Zod →

Step input or application code

{
  "requestId": "case-42",
  "orders": [
    {
      "id": "9007199254740995",
      "total": 12900,
      "coupon": null
    },
    {
      "id": "9007199254740996",
      "total": 0,
      "coupon": "WELCOME",
      "retryable": false
    }
  ]
}

Execution result or applied output

export type OrderBatch_ordersItem = {
  "id": string;
  "total": number;
  "coupon": null | string;
  "retryable"?: boolean;
};

export type OrderBatch = {
  "requestId": string;
  "orders": (OrderBatch_ordersItem)[];
};

Across the nested order samples, coupon becomes a string or null and retryable an optional boolean. This merges observed response shapes; it does not guarantee the full API contract.

3. Run the generated Zod schema against a mismatch

Use the Zod Schema output in a separate Node project. The complete example below appends safeParse calls for the original sample and a response whose total is a string. It was executed with the repository’s installed Zod 4 to obtain the output on the right.

Step input or application code

import { z } from 'zod';

export const OrderBatch_ordersItemSchema = z.object({
  "id": z.string(),
  "total": z.number(),
  "coupon": z.union([z.null(), z.string()]),
  "retryable": z.boolean().optional(),
});

export const OrderBatchSchema = z.object({
  "requestId": z.string(),
  "orders": z.array(OrderBatch_ordersItemSchema),
});

const sample = {
  "requestId": "case-42",
  "orders": [
    {
      "id": "9007199254740995",
      "total": 12900,
      "coupon": null
    },
    {
      "id": "9007199254740996",
      "total": 0,
      "coupon": "WELCOME",
      "retryable": false
    }
  ]
};
const mismatched = {
  "requestId": "case-43",
  "orders": [
    {
      "id": "9007199254740997",
      "total": "12900",
      "coupon": null
    }
  ]
};
console.log(OrderBatchSchema.safeParse(sample).success);
console.log(OrderBatchSchema.safeParse(mismatched).success);

Execution result or applied output

true
false

The results are true, then false. This verifies runtime rejection, but not business rules such as currency, valid amounts or whether an order ID exists.

When it fails: reproduce and recover

Formatting fails on a trailing comma

{"requestId":"case-42","orders":[],}

Remove the final comma after orders and format again. Errors block copying or transferring the previous result. Hand over the corrected, current result rather than the invalid original.

A numeric total changes to a string

{
  "requestId": "case-43",
  "orders": [
    {
      "id": "9007199254740997",
      "total": "12900",
      "coupon": null
    }
  ]
}

The schema generated from the original numeric sample rejects this response. Compare the server contract and response to fix the cause. Re-generating from only this bad sample would infer a string instead of discovering the contract error for you.

Keep exact IDs as strings because JavaScript numbers have precision limits. Zod strips unknown keys by default, and business rules need additional validation. Type generation cannot fix a 401 authentication failure. The related JWT tool inspects time claims and does not verify signatures.

Case B

Mask and review a log before estimating prompt cost

Before asking AI about a 401 error, is hiding Authorization and the URL enough? This synthetic log deliberately includes a plain password assignment that automated rules miss. Separate automatic output, the manually reviewed prompt and its final text token count.

Enable all Code & Log Masking options. Select GPT-4o or GPT-4o-mini in the token calculator. Do not use real keys or customer logs.

1. Inspect the automatic masking result

Paste the synthetic log into the masking tool with every option enabled and compare the output below. No AI API is called for this transformation.

Code & Log Masking →

Step input or application code

[SYNTHETIC] POST /v1/orders status=401
Authorization: Bearer demo-access-token
endpoint=https://sandbox.example.test/orders?token=demo-query
password=demo-plain-not-covered
note=한글 오류를 설명해 주세요.

Execution result or applied output

[SYNTHETIC] POST /v1/orders status=401
Authorization: Bearer [BEARER_TOKEN]
endpoint=[URL]
password=demo-plain-not-covered
note=한글 오류를 설명해 주세요.

The Bearer value and entire URL change, but password=demo-plain-not-covered remains. Treat this as a draft to review, not a completed sharing decision.

2. Redact the missed value and add the question

Manually replace the password value with [MANUAL_REDACTION], then add a question asking for an explanation using only the synthetic log. Compare input and output line by line. This is a human review step, not another automatic feature.

Step input or application code

[SYNTHETIC] POST /v1/orders status=401
Authorization: Bearer [BEARER_TOKEN]
endpoint=[URL]
password=demo-plain-not-covered
note=한글 오류를 설명해 주세요.

Execution result or applied output

Explain the 401 response using only this synthetic log:
[SYNTHETIC] POST /v1/orders status=401
Authorization: Bearer [BEARER_TOKEN]
endpoint=[URL]
password=[MANUAL_REDACTION]
note=한글 오류를 설명해 주세요.

The next tool receives the entire reviewed prompt on the right. Fixing one missed field does not prove every secret is gone; review identifiers, paths and other plain text too.

3. Separate token count from the model’s input rate

Paste the reviewed prompt into the token calculator and select GPT-4o and GPT-4o-mini in turn. The output below lists text encoding counts and the formula. Review cost using the tool’s displayed model rate, official source and check date.

Prompt Token Calculator →

Step input or application code

Explain the 401 response using only this synthetic log:
[SYNTHETIC] POST /v1/orders status=401
Authorization: Bearer [BEARER_TOKEN]
endpoint=[URL]
password=[MANUAL_REDACTION]
note=한글 오류를 설명해 주세요.

Execution result or applied output

gpt-4o: 58 tokens
gpt-4o-mini: 58 tokens
USD = tokens * displayedPricePer1M / 1000000

These models use the same encoding, so this input has the same token count. Cost applies the selected model’s displayed input rate and is not a total API bill. This guide does not invent or freeze a new rate.

When it fails: reproduce and recover

A plain password remains after masking

password=demo-plain-not-covered

Current rules do not detect this ordinary password assignment. Remove or manually replace the value, then compare original and result. Zero matches or no error is not permission to share.

A special token causes calculation to fail

Explain the 401 response using only this synthetic log:
[SYNTHETIC] POST /v1/orders status=401
Authorization: Bearer [BEARER_TOKEN]
endpoint=[URL]
password=[MANUAL_REDACTION]
note=한글 오류를 설명해 주세요.
<|endoftext|>

Remove the disallowed special token at the end of the prompt below and calculate again. An error must clear the prior count and cost. Do not use stale numbers to make a budget decision.

Rule-based masking does not guarantee secret detection or anonymization. Text encoding counts exclude system instructions, message formatting, tools, images, output and caching costs. Claude uses a GPT-based approximation with no cost estimate. This workflow does not send anything to an AI service.

Case C

Apply a small status icon in HTML and CSS

You want to put a 12×12 icon next to status text without a separate image request. Read a new synthetic SVG, adapt the converter’s filename-based alt to its context, and use the same Data URL as a CSS decoration.

Use the status-badge.svg download below and Image to Base64. The two application examples are alternatives for the same icon; they need not be applied together.

1. Select the SVG and compare its Data URL

Download the synthetic SVG and select it in the image tool. The input lists its filename and actual UTF-8 contents. The output encodes the original file without transforming it.

Image to Base64 →

Step input or application code

status-badge.svg
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><rect width="12" height="12" rx="3" fill="#4f46e5"/></svg>

Execution result or applied output

data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgdmlld0JveD0iMCAwIDEyIDEyIj48cmVjdCB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHJ4PSIzIiBmaWxsPSIjNGY0NmU1Ii8+PC9zdmc+
Download synthetic status-badge.svg

Filename and output appear together after the browser decodes the SVG preview. Renaming an invalid file to SVG does not make it valid. Original file size and Data URL string length are different measurements.

2. Adapt the HTML alt to the surrounding content

Copy the tool’s HTML tag on the left and add dimensions and adjacent status text as on the right. Here the text conveys the meaning, so the decorative icon uses empty alt. An icon carrying information on its own needs descriptive alt.

Image to Base64 →

Step input or application code

<img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgdmlld0JveD0iMCAwIDEyIDEyIj48cmVjdCB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHJ4PSIzIiBmaWxsPSIjNGY0NmU1Ii8+PC9zdmc+" alt="status-badge.svg" />

Execution result or applied output

<span class="sync-status"><img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgdmlld0JveD0iMCAwIDEyIDEyIj48cmVjdCB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHJ4PSIzIiBmaWxsPSIjNGY0NmU1Ii8+PC9zdmc+" width="12" height="12" alt="" /> Sync ready</span>

The converter uses the filename as default alt, which is not always a useful description. Image loading, dimensions and alt were checked in the browser. Review context rather than pasting generated markup unchanged.

3. Use the same Data URL as a CSS background

Put the CSS output’s background-image declaration into the rule on the right. The pseudo-element needs content, width and height to be visible. Compare the HTML image and CSS decoration below.

Image to Base64 →

Step input or application code

background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgdmlld0JveD0iMCAwIDEyIDEyIj48cmVjdCB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHJ4PSIzIiBmaWxsPSIjNGY0NmU1Ii8+PC9zdmc+');

Execution result or applied output

.sync-status-css::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 0.5rem;
  background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgdmlld0JveD0iMCAwIDEyIDEyIj48cmVjdCB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHJ4PSIzIiBmaWxsPSIjNGY0NmU1Ii8+PC9zdmc+');
  background-size: contain;
}
/* HTML: <span class="sync-status-css">Sync ready</span> */

CSS backgrounds have no alt. Put important status information in real text. The browser check confirmed a 12×12 pseudo-element and its background image loading. This is not a claim of better performance.

Applied on this page

HTML image · Ready to syncCSS decoration · Ready to sync

When it fails: reproduce and recover

A file says SVG but its preview fails

broken.svg (image/svg+xml): not-an-image

Selecting not-an-image bytes with image/svg+xml produces a decoding error. Re-select the valid download. The old preview, metadata and code must not remain after failure.

Pasting an entire Data URL into text Base64

data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgdmlld0JveD0iMCAwIDEyIDEyIj48cmVjdCB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHJ4PSIzIiBmaWxsPSIjNGY0NmU1Ii8+PC9zdmc+

The data:image/svg+xml;base64, prefix is not Base64 bytes. Use the image tool for image representations. Text Base64 is a separate tool for standard Base64 containing UTF-8 text, not arbitrary image binary recovery.

No image compression or optimization is performed. Large assets increase document size and memory use and may prevent reuse through a separate-file cache. Browser decoding and MIME checks are not security validation. Do not confuse them with permission to insert untrusted SVG markup directly into HTML.

Back to the tool collection