How to Format JSON

What i’m trying to do, is for example

IN LUA

["Error"] = {
	Pass = "Error",
	Member = "Error++",
	Exp = "Infinite",
	Expire = {
		Month = 1,
		Day = 1
	}
},
["Error2"] = {
	Pass = "Error2",
	Member = "Error++",
	Exp = "Infinite",
	Expire = {
		Month = 1,
		Day = 1
	}
}

How to format this into JSON?

EDIT :

I’m trying to receive this data from an external website.

Are you looking for HttpService:JSONEncode?

No, Im using a external website to put that data in. then decoding it. but the flaw seems to be in my formatting.

Can you elaborate by what you mean with “put that data in”? I mean, you should be able to encode a Lua table through :JSONEncode, and decode a JSON string through :JSONDecode. I currently don’t see how your formatting is going to cause an issue

Alright, so i have a external website. i :HttpGet() the raw text,

Here’s how i tried formatting it.

{
	"Quuar" : [{
		"Pass" : "Quarrity",
		"Member" : "Owner++",
		"Exp" : "Infinite",
		"Expire" : [{
			"Month" : 12,
			"Day" : 31
		}]
	}],
	"24Promo" : [{
		"Pass" : "Fr33",
		"Member" : "Free",
		"Exp" : "6/4/2021",
		"Expire" : [{
			"Month" : 4,
			"Day" : 6
		}]
	}],
}

i get the raw text from a pastebin btw.

A website returns a JSON that got converted to a string, and if you want to reconvert it on roblox, use HttpsService:JSONDecode()

{
	"Quuar" : {
		"Pass" : "Quarrity",
		"Member" : "Owner++",
		"Exp" : "Infinite",
		"Expire" : {
			"Month" : 12,
			"Day" : 31
		}
	},
	"24Promo" : {
		"Pass" : "Fr33",
		"Member" : "Free",
		"Exp" : "6/4/2021",
		"Expire" : {
			"Month" : 4,
			"Day" : 6
		}
	},
}

You could simply use

local tbl = {}
print(game:GetService("HttpService"):JSONEncode(tbl))

in the command bar and copy the output.