Base64 輸入
0 characters
JSON 輸出
所有解碼都在瀏覽器中本地進行。您的數據永遠不會離開您的設備,確保完全的隱私和安全。
格式化輸出
解碼后的 JSON 會自動格式化,並帶有適當的縮進和語法高亮顯示,以便於閱讀。
高級功能
獲取有關 JSON 結構的詳細統計資訊,包括鍵計數、深度分析和大小估計。
如何使用Base64到 JSON 解碼器
1準備Base64數據
您需要一個表示 JSON 數據的 Base64 編碼字串。這通常存在於 JWT 令牌、API 回應或數據儲存格式中。
Base64 字串示例:eyJ0aXRsZSI6IkJhc2U2NCBGb3JtYXQiLCJkZXNjcmlwdGlvbiI6IkNvbnZlcnQgQmFzZTY0IHRvIEpTT04iLCJ2ZXJzaW9uIjoxLjB9
2解碼為 JSON
將您的Base64字串粘貼到輸入欄位中,然後按兩下「解碼為 JSON」按鈕。該工具將自動解碼和格式化 JSON。
{
"title": "Base64 Format",
"description": "Convert Base64 to JSON",
"version": 1.0
}
3使用解碼的 JSON
解碼后,您可以將 JSON 複製到剪貼板,將其下載為檔,或使用提供的統計數據分析其結構。
4常見用例
- Decoding JWT (JSON Web Tokens)
- 調試 API 回應
- 使用存儲中的編碼數據
- 分析序列化的 JSON 結構
- 開發和測試應用程式
用於Base64和 JSON 處理的常用庫
JavaScript
js-base64 庫
js-base64 庫為 JavaScript 提供了健壯的 Base64 編碼/解碼:
// Encode to Base64 const encoded = Base64.encode('Hello World'); // Decode from Base64 const decoded = Base64.decode(encoded); // Parse JSON const json = JSON.parse(decoded);
在 npm 上訪問 js-base64
Python
Python 的標準庫包括 Base64 和 JSON 的模組:
import base64 import json # Encode to Base64 encoded = base64.b64encode(b'Hello World') # Decode from Base64 decoded = base64.b64decode(encoded) # Parse JSON data = json.loads(decoded)
Java
java.util.Base64
Java 8 在標準庫中包括 Base64 編碼/解碼:
import java.util.Base64; import com.google.gson.Gson; // Encode to Base64 String encoded = Base64.getEncoder() .encodeToString("Hello World".getBytes()); // Decode from Base64 String decoded = new String( Base64.getDecoder().decode(encoded)); // Parse JSON with Gson Gson gson = new Gson(); MyObject obj = gson.fromJson(decoded, MyObject.class);