Trending November 2023 # What Computer Do I Have? How To Check Specs & Model # Suggested December 2023 # Top 11 Popular

You are reading the article What Computer Do I Have? How To Check Specs & Model updated in November 2023 on the website We hope that the information we have shared is helpful to you. If you find the content interesting and meaningful, please share it with your friends and continue to follow and support us for the latest updates. Suggested December 2023 What Computer Do I Have? How To Check Specs & Model

Even if you are a casual computer user, it is always ideal that you know your PC better. Besides this, if you know your PC specification, you can easily determine whether an application is supported on your computer before installing them.

So today, we are here to give you a step-by-step guide on how to get computer details or check computer specifications. So, without further ado, let’s get right into it. 

Check Specification on Windows

There are several ways you can check your system information on Windows. Such as Command Prompt, using System Information, from Computer Properties, Task Manager, and a lot more.

Here, we have explained the process for each method in detail.

Using System Information

Windows has offered its users this great utility that lets you check all details about your system. This utility is called System Information. 

Please follow the steps mentioned below to open System Information.

Using Command Prompt

One alternative to using system specifications would be using a command prompt. From Command Prompt, you can get even more details about your system compared to System Information. 

Please follow these steps to get system specifications using Command Prompt.

From Computer Properties

To get your PC specification using Computer Properties, please follow the steps mentioned below.

Using DirectX Diagnostic Tool

The DirectX Diagnostic, or the DxDiag tool, is a troubleshooting feature that lets you pinpoint any issues with the PC’s DirectX. Besides this, this tool also lets you get details about your system, display, sound, and input devices.

Please follow these steps to get system details using DirectX Diagnostic Tool.

Get Details About Specific PC Components

All these above-mentioned steps will give you overall computer specification. But if you want details on each component, such as processor cores, RAM speed, GPU specification, or hard disk storage, it is recommended that you use Task Manager, Device Manager, or Disk Partition.

RAM Specification

RAM size and speed are one of the components that determine a computer’s speed and how many tasks it can handle. So, it is only ideal that you, a regular consumer, know these details. 

Follow these steps to check your system’s RAM details.

These details include the computer’s total RAM, RAM in use, RAM speed, number of slots used, available RAM, etc.

CPU Details

Similar to RAM, you can get a detailed CPU specification from the Task Manager. Please follow the steps mentioned below to access them.

GPU Details

You can either use the Task Manager or the Device Manager to get your GPU details. Fortunately, we have mentioned the steps to both of them.

Using Device Manager

Using Device Manager, you can determine whether your PC has a dedicated GPU.

Using Task Manager

Now, to check your GPU details, follow these steps.

Storage Details

Storage details that you see on This PC (My Computer) are not always accurate. Sometimes, partitions may be hidden and therefore you will get the wrong information about the storage,

To get the actual storage details, you can open a Window Utility called Disk Management.

We also have an article explaining how to use Disk Management in detail. You might find it an interesting read.

Monitor Information

Follow these steps to check your monitor details.

How to Check My Laptop Model?

Using System Information, you can get details about your laptop if you are using Windows. However, if you want your laptop’s exact model name, please follow the steps mentioned below.

Open Run and type cmd to open Command Prompt.

Type wmic csproduct get name without quotation mark and press Enter. 

The command will now display your laptop’s model name.

Using this and the internet, you can easily get all the information you need about your laptop. 

Check Specification on Macbook

To check the specification on a Macbook, please follow the steps mentioned below. 

Here, you can see the Operating System currently running on your MacBook. Besides this, it also shows your computer’s model, processor, memory, storage, graphics, and serial number.

You're reading What Computer Do I Have? How To Check Specs & Model

What Iphone Model Do I Have? Find Your Iphone Model

Many iPhone models look alike. Sure, if you are tech-savvy, you might know about the differences by seeing the camera style, antenna lines, dimensions, etc. But what about general folks! Well, if you are someone who has trouble knowing what iPhone model do you have or which one you are about to buy second hand, here’s an easier way to find out. Let me guide you through the process of identifying various iPhone models.

How Can I Find Out Which iPhone Model I Have?

Identify the iPhone model number using the steps below and confirm it with the list at the end of this post.

Use the Settings App

Turn on the iPhone and open the Settings app.

Tap on General and tap on About.

Tap on Model Number. You will see a number starting with ‘A.’ This is your iPhone’s model number.

Look Inside the Sim Slot

On newer iPhones (8 and later), the model number is etched inside the SIM slot. The tiny alphabets are tough to read. Make sure you have a flashlight or a second mobile phone with a torch.

Use the ejector to take out the SIM tray. Put it safely aside.

Now, point the flashlight inside the SIM slot. You will see the tiny text on the upper edge of the slot.

See the Back of the iPhone

On older iPhones (7 and earlier), the model number is written at the back of the device. It is easily visible.

Remove any case, cover, skin, or opaque protector from the back of your iPhone.

In the lower back, you will see the model number. It starts with the alphabet ‘A.’

Full List of iPhones with their Corresponding Model Number

Once you know the model number (after following one of the above methods), match that number with the list below to identify which iPhone you have.

iPhone 12 Pro Max

A2342 (United States)

A2410 (Canada, Japan)

A2412 (China mainland, Hong Kong, Macao)

A2411 (other countries and regions)

iPhone 12 Pro

A2341 (United States)

A2406 (Canada, Japan)

A2408 (China mainland, Hong Kong, Macao)

A2407 (other countries and regions)

iPhone 12

A2172 (United States)

A2402 (Canada, Japan)

A2404 (China Mainland, Hong Kong, Macao)

A2403 (other countries and regions)

iPhone 12 mini

A2176 (United States)

A2398 (Canada, Japan)

A2400 (China mainland)

A2399 (other countries and regions)

iPhone SE (2nd generation)

A2275 (Canada, United States)

A2298 (China mainland)

A2296 (other countries and regions)

iPhone 11 Pro Max

A2161 (Canada, United States)

A2220 (China mainland, Hong Kong, Macao)

A2218 (other countries and regions)

iPhone 11 Pro

A2160 (Canada, United States)

A2217 (China mainland, Hong Kong, Macao)

A2215 (other countries and regions)

iPhone 11

A2111 (Canada, United States)

A2223 (China mainland, Hong Kong, Macao)

A2221 (other countries and regions)

iPhone XS Max

A1921, A2101

A2102 (Japan)


A2104 (China mainland)

iPhone XS

A1920, A2097

A2098 (Japan)


A2100 (China mainland)

iPhone XR

A1984, A2105

A2106 (Japan)


A2108 (China mainland)

iPhone X

A1865, A1901

A1902 (Japan)

iPhone 8 Plus

A1864, A1897

A1898 (Japan)

iPhone 8

A1863, A1905

A1906 (Japan)

iPhone 7 Plus

A1661, A1784

A1785 (Japan)

iPhone 7

A1660, A1778

A1779 (Japan)

iPhone 6s Plus

A1634, A1687, A1699

iPhone 6s

A1633, A1688, A1700

iPhone SE (1st generation)

A1723, A1662, A1724

iPhone 6 Plus

A1522, A1524, A1593

iPhone 6

A1549, A1586, A1589

iPhone 5s

A1453, A1457, A1518, A1528, A1530, A1533

iPhone 5c

A1456, A1507, A1516, A1529, A1532

iPhone 5

A1428, A1429, A1442

iPhone 4s

A1431, A1387

iPhone 4

A1349, A1332

iPhone 3GS

A1325, A1303

iPhone 3G

A1324, A1241

iPhone (The 1st iPhone)


Signing Off

This is how you can know what iPhone do you have. Once you know this, it becomes easier to learn more about the device and its specific features.


Author Profile


I have been an Apple user for over seven years now. At iGeeksBlog, I love creating how-tos and troubleshooting guides that help people do more with their iPhone, iPad, Mac, AirPods, and Apple Watch. In my free time, I like to watch stand up comedy videos, tech documentaries, news debates, and political speeches.

How To Check What Hard Drive You Have On Windows 11/10

Most of the consumers have a laptop or a desktop computer, but they have no idea what kind of storage device they use. For example, an SSD makes a huge difference in performance compared to HDD. In this post, we will show how to check what Hard Drive you have on Windows 11/10.

How to check what Hard Drive you have

What Hard Disk do I have? Do I have an SSD, HDD, or Hybrid Drive? How to check the Specifications & RPM of the Hard Drive of your Windows computer? These are some of the questions we will try to answer using inbuilt solutions and free software applications.

Using Device Manager

Using the MSInfo32 Tool

Using PowerShell

Using a third-party tool

Not all the tools can display RPM and Media type of the hard disk. Some of them only find the model number, while others can only tell you the RPM. Be aware that a Solid State Drive doesn’t have RPM, i.e., there are no spinning platters like HDD.

1] Using Device Manager

While the Device Manager doesn’t directly display RPM or Disk type, it can have other details, including the model number of the storage device.

Use WIN+X to open the Power menu and select Device Manager

Navigate the tree and locate Disk Drives. Expand it

Switch to Details section, and then select Hardware IDs from the Property dropdown.

The model number will be available along with some other details. So in this case, it is DISKST3500418AS. Hence the model number would be ST3500418AS

Now search the model number in Google or on Amazon. Wwbsites like chúng tôi can give you the complete information. If the drive is an SSD, it will be mentioned explicitly.

2] Using the MSInfo32 Tool

You can also use the msinfo32 tool in Windows to find the manufacturer and model number. Once you have that search on Google or any website which offers details based on the model number of the hardware. Sometimes the model name in the listing will have SSD included in the MSInfo32 tool. Otherwise, you will have to search via the device model number.

3] Using PowerShell

Use WIN + X to open power menu and select PowerShell Admin to launch it

Type and run the command Get-PhysicalDisk 

The output will have a column with the name Media Type.

Check if it is HDD or SSD

To find the RPM using PowerShell, you will need to run the following command as mentioned in this thread.

$ComputerName = ".", "." ForEach ($C in $ComputerName) { $Hash = @{ "ComputerName" = $C "namespace" = "rootMicrosoftWindowsStorage" "Class" = "MSFT_PhysicalDisk" "ErrorAction" = "Stop" } Try { Select-Object -Property @{N="ComputerName"; E={$C}}, @{N="Speed(RPM)";E={$_.SpindleSpeed}}, DeviceID, @{N="Supported";E={$True}} } Catch { $Obj = New-Object -TypeName PSObject -Property @{ "ComputerName" = $ComputerName "Speed" = $Null "DeviceID" = $Null "Supported" = $False } Write-Output $Obj } }

You can also use Disk Defragmenter and Windows Command Prompt to find out if it is an SSD or HDD.

4] Using third-party tools

Crystal Disk Info is a handy tool if you want to check the health of your hard disk. While the software doesn’t tell about SSD or HDD, it can show RPM of the storage device.

Free PC Audit is another free tool that is one of the rare tools that can find Media Type for the storage device. Once you locate the disk section, expand it, and select media type to see if the storage devices are SSD or HDD. Download it from the official page.

If you want to upgrade to SSD, but aren’t sure if full SSD configuration works better or HDD, then read our ultimate guide on Hybrid Drives.

I hope the set of recommended tools were useful to check what Hard Drive you have on Windows 11/10.

Vision Pro: I Just Tried Apple’s First Spatial Computer, And Here’s What I Think

When I arrived at the demo building on the far corner of Apple Park, I was then whisked away once again… into an alternate world powered by visionOS.

The setup process

When I arrived at Apple’s special demo building, I went through the process of being fitted for Vision Pro. This was done using a simple scanning system on an iPhone 14 that was similar to the process of setting up Face ID on a new iPhone. The next step was setting up Spatial Audio, which consisted of scanning my face and both ears.

I had some trouble with the Personalized Spatial Audio part of the setup experience, but it didn’t seem to have an impact on the actual Vision Pro experience. The iPhone 14 just didn’t want to scan my left ear for some reason.

I wear contacts rather than glasses, so I didn’t have to go through the vision testing portion of the experience. For those who wear glasses, however, Apple had vision test equipment set up.

Using visionOS

There’s absolutely a learning curve to figuring out how to navigate around visionOS, but even in my 30 minutes with Vision Pro, I became pretty comfortable with most of the gestures. There were a few times that I selected the wrong thing and ended up in the wrong app, but it was easy enough to navigate back to the home screen by simply pressing the Digital Crown.

visionOS allows you to open multiple apps and arrange them as you see fit. The interface for doing this is similar to Stage Manager on the iPad, with a “Window Bar” at the bottom of each app to adjust positioning and an arrow in the corner to adjust the size of each app. You can also bring windows closer to you by tapping with your fingers and pulling them closer.

For most people, that learning curve is going to be the most challenging aspect of Vision Pro. I have to imagine that the gestures become second nature at some point, but you’ll have to practice to get there. I’m assuming that visionOS will offer a robust user tutorial on the first run when it launches to customers next year. Apple will also offer demos at its retail stores for customers.

Content consumption and environments

Apple is pitching content consumption as one of the biggest selling points of Vision Pro, and rightfully so. The experience is absolutely incredible. I had the chance to explore a 3D version of Avatar 2 and was blown away by the immersiveness.

You can watch content via Vision Pro in a floating window that you can adjust to your liking, and visionOS will automatically dim the area around that window. You can also put the movie in an environment of your choosing. I got to watch a movie using the Cinema Environment, which made it seem like I was watching in a dedicated home theater. The attention to detail was remarkable, down to acoustic-foam-style textures on the ceiling.

Watching 3D movies with Vision Pro is proof that 3D movies can be incredibly immersive and downright cool if done right. 3D TVs may have been a short-lived fad, but Vision Pro nails the experience.

I also got to watch a clip of an NBA game while wearing Vision Pro, as well as an MLB game. Both of these experiences were incredible. I could look up, down, left, and right and feel as if I was in the stadium, sitting courtside or right alongside the first base line. There was also a clip that was taken inside a music studio with Alicia Keys. I’ve written a lot about how concerts can be a big selling point of Vision Pro, and this demo only further proved that point to me.

Apple explained to me that every video I watched was shot in its own custom video format. It hopes that other companies will adopt this format, but as of right now, it had nothing to announce on this front beyond what it showcased with Disney during the keynote.

Along the side of the visionOS interface is a menu that expands to show “People, Apps, and Environments.” I chose the Environments option and saw one called “Mount Hood,” which was fully immersive and surrounded me on either side and behind me. This is also one of the times I used the Digital Crown to control my level of immersion. At any point, I could raise my hand it would appear on top of the mixed reality interface.


The Photos app is a key part of the Vision Pro experience. You can view your entire Photos library and use gestures to select photos, scroll between photos, zoom in and out, and more. You can view panoramic photos shot on iPhone that wrap all the way around you. I saw two different panoramic iPhone images that were taken in Iceland and on the Oregon coast.

Spatial photos and videos are captured via the Vision Pro’s built-in 3D camera. Apple says these are meant to let users “capture, relive, and immerse themselves in favorite memories.”

“Every spatial photo and video transports users back to a moment in time, like a celebration with friends or a special family gathering,” Apple explains.

During my demo, I saw two spatial videos: one taken at a kid’s birthday party and another taken at a campfire. These were both very impressive and did a great job at making it feel as if I was in those memories myself. The demos were admittedly a bit creepy since these weren’t my memories, but it’s easy to see how incredible this feature will be when that changes.


During my hands-on time with Vision Pro, I took a FaceTime call from someone else in the building who was also wearing Vision Pro. This person was reflected in my Vision Pro view using a Persona, which Apple describes as a digital representation of the person created using machine learning techniques.

The Persona was very convincing, but once I started looking more closely, it was clear that it was an artificially generated video. This was especially noticeable around the person’s mouth.

While on the FaceTime call, we collaborated on a Freeform document that included a 3D model of an apartment building. I could look inside that model to view specific details about the design, the corners, the furniture, and more. The 3D model took a while to load and was a bit buggy, which led to my overall mixed experience with FaceTime.

Comfort and motion sickness

I wore Vision Pro for about 30 minutes, and my experience was overall positive. The fabric is soft and breathable, there’s a lot of padding around the eyes, and it felt snug (but not too snug) on my head.

That being said, it’s definitely on the heavier side of things. I could absolutely see getting tired of wearing it after extended sessions. The overall design and fit reminded me quite a bit of AirPods Max and many of the materials were similar.

One thing Apple said today is that it only had a small selection of the Light Seal sizes available during these demos. When Vision Pro launches, however, there will be a vast set of Light Seal sizes available. This will help further perfect the comfort for all users.

Apple says that the combination of two 4K displays and incredibly low latency are big factors in preventing people from getting motion sick while wearing Vision Pro. The ability to move in and out of virtual reality and augmented reality also plays a major role in reducing motion sickness and fatigue.

Other tidbits

I took part in a one-minute mindfulness meditation that featured immersive animations and guided breathing exercises. I definitely needed this after the two-hour keynote!

One of the demos saw me interact with a butterfly, which flew toward me and landed on my hand. There was also an Encounter Dinosaurs interactive experience, during which I walked toward the dinosaur and “touched it.” This was cool but a bit gimmicky. It’s a fun proof of concept for what could be possible in the future, though.

I didn’t get to try any of the Mac-focused features, but I’m eager to learn more about those in the future.

I didn’t get a chance to see anyone else wearing Vision Pro, so I didn’t get to see the EyeSight part of the experience.

I saw an Apple Immersive Video demo that wrapped me in a 180-degree view as if I was flying above a city, under the ocean, in a field full of wildlife, and more.


When I took Vision Pro off after my 30-minute demo, I felt a bit discombobulated. Not necessarily in a bad way, but it was a feeling I’d never experienced before. I had just experienced something that transported me to another world… while also keeping me somewhat connected to the “real world” around me.

This is key to the Vision Pro experience, and it’s something that sets Apple apart from other players in this space. The hybrid of virtual and augmented reality strikes a really good balance of immersiveness while keeping you engaged with people around you.

Do some features of Vision Pro seem gimmicky? Absolutely. But much of what I saw today is proof of just how impressive mixed reality can be when it’s done right, using top-of-the-line hardware and software. As the ecosystem expands, some of the content that may seem gimmicky can be replaced with incredible experiences.

The hardware of Vision Pro is absolutely industry-leading. I couldn’t see a single pixel on the 4K displays, and even the edges of the content on either side of me were crisp and clear. The combination of those displays and the powerful M2 and R1 chips inside mean that Vision Pro excels at everything it does.

Vision Pro won’t be a runaway success, and I think even Apple knows that. The company likened the $3,500 price to that of the original Mac, which sold for $2,495 in 1984. In 2023 dollars, that would be over $7,000.

But even if there aren’t lines wrapping around Apple Stores on launch day, Vision Pro will give Apple a way to get its work in this market out into the wild. Developers can create apps, movie and TV studios can create content, and Apple can learn more about what people want from a product like this.

Follow Chance: Twitter, Instagram, and Mastodon

FTC: We use income earning auto affiliate links. More.

How To Check Hardware Specs Of Windows 11 Pc (8 Methods Explained)

While most people today live connected lives with a multitude of electronic gadgets at their disposal, only a few bother to think about the hardware components that go into their smartphones, gaming consoles, or computers. However, it is relatively easy to learn about the specifications of the phones and PCs you use in your digital life. With that said, let us show you how to check the hardware specs and configuration of your Windows 11 PC.

Check Hardware Specs and Configuration of Windows 11 PC (2023)

There are many ways to check the hardware specifications of your Windows 11 PC, and we will detail them all in this article today. You can check the hardware specs of your Windows 11 computer via the Settings app, System Information, DirectX Diagnostic tool, Command Prompt, and a myriad of third-party applications. So let’s get started!

Steps to Check Hardware Specs of Windows 11 PC

As we mentioned above, there are various ways to check the hardware specifications of your Windows 11 computer. We will explain all of them here in this guide, starting with the easiest method – via Windows Settings.

Method 1: Using the Settings App

The easiest way to find information about the hardware on your Windows PC is using the Settings app. Here’s how you do it:

Under the Device specifications section, you can check the key hardware specs for your Windows 11 PC, including the processor, system memory (RAM), architecture (32-bit or 64-bit), and more.

Now, scroll down a bit to the Windows specifications section to check information about your operating system. It includes the edition, version, installation date, OS build , and the service pack (Microsoft calls it Experience).

Method 2: System Information (msinfo32)

Another easy way to check the hardware specs of your Windows 11 PC is through the System Information panel. Here’s how you do it:

Open the Run dialog box by pressing ‘Windows key + R’ simultaneously. Then, type in or copy + paste msinfo32 and hit Enter.

With System Summary selected on the left sidebar, you can check several aspects of your computer’s hardware. It includes the system model and type, processor brand and model, UEFI/ BIOS version, RAM capacity, motherboard brand and model, and also virtualization support, among other things.

Method 3: DirectX Diagnostics (dxdiag)

Windows 11 also includes the DirectX Diagnostic Tool (dxdiag) to view information about DirectX audio and video support. You can also use it to check many system specs. Here’s how:

Open the Run dialog box as described in Method 2. Now, type in dxdiag and hit Enter.

Note: You can also search for ‘dxdiag’ (without quotes) in the Windows search bar to access the feature.

Now, move to the Display tab at the top. Here, under the ‘Device’ section, you can find details about your GPU, including the name and manufacturer, graphics memory, and display details.

Note: You can create a specs report for future reference using the ‘Save All Information’ button at the bottom.

Method 4: Command Prompt

First, open a Command Prompt window in Admin mode. To do that, search for ‘cmd‘ (without quotes) in the Windows search bar and select Run as administrator.

Now, type in or copy + paste systeminfo in the Command Prompt window and hit Enter. You will see detailed hardware and software information about the computer. It includes info on the system architecture, whether it uses BIOS/ UEFI, RAM, network details, and Windows 10 update information.

Method 5: PowerShell

You can also use PowerShell to view the system specifications of your Windows 11 computer. Follow the guide below to do that:

In the PowerShell window, type Get-ComputerInfo and press Enter.

To view details of a specific component, use the following modified command: Get-ComputerInfo -Property "property name*". Replace “property name” with the name of the component you want more information on. For example, to get details about your Windows installation, use the following command: Get-ComputerInfo -Property "windows*"

Note: The asterisk at the end is a wildcard that ensures PowerShell will display every property that starts with ‘Windows’.

Method 6: Device Manager

Alternatively, you can natively view the system specs on your Windows 11 PC through the Device Manager. Here’s how you do that:

Open the Run dialog box as explained earlier in the article. Then, type in devmgmt.msc and hit Enter. The Device Manager window will now open.

Device Manager displays a list of everything that’s built into your PC, either desktop or laptop. Go through each item on the list and check the names and model numbers of the hardware specs in your Windows 11 PC.

Method 7: Third-Party Applications

Alongside the aforementioned native methods, there are also a plethora of third-party applications that offer you information about your system hardware to varying degrees. Some of the oldest and most accurate ones are listed below:

CPU-Z (download)

HWiNFO (download)

AIDA64 (download)

Speccy (download)

Open Hardware Monitor (download)

All of these tools are either free-to-use or shareware, with the last one even being open-source. You can use them to check information about your computer’s hardware. For demo purposes, we are using CPU-Z, which offers detailed information about the computer’s CPU, motherboard, RAM, GPU, etc. Open the program and navigate to the relevant tab to get all the details about that component.

Method 8: Open up Your Computer Case

Most of the hardware parts have at least the basic information printed or inscribed on them. That includes the CPU, GPU, motherboard, RAM, PSU, etc. For custom-built PCs, you can find all the info, although it might be a little more difficult in the case of OEM devices.

Easily Check Your Windows 11 PC Hardware Configuration!

As you can see, checking the full configuration of your PC is relatively easy. The best part is that there are multiple ways of doing that, and we have covered pretty much all in our article today. So now that you know how to view the hardware specs of your Windows 11 PC, check out a few other guides that might be of use for you. That includes how to prevent your PC from overheating, how to improve your Windows laptop’s battery life, and how to change Power Mode settings in Windows 11.

How Do I Write Json In Python?

In this article, we will learn different types of methods to write JSON in python.

Conversion Rules

When converting a Python object to JSON data, the dump() method follows the conversion rules listed below −

Writing Dictionary into a JSON File

The function of json.dump() is to arrange a Python object into a JSON formatted stream into the specified file.

Syntax dump(obj, fp, *, skipkeys=False, check_circular=True, allow_nan=True, indent=None, separators=None, default=None, sort_keys=False, **kw) Parameters

obj − obj is known as object that arranges as a JSON formatted stream.

fp −the fp also know as file object will store JSON data.

skipkeys − The default value is False. It ignores the Keys of dict that are not of a basic type. Orelse, it will throw a TypeError.

check_circular − It’s default value is True. It’s main task is to perform circular reference check for container types. This sometimes get the output result in an OverflowError.

allow_nan − It’s e default value is True. If false, serializing out-of-range float values will result in a chúng tôi uses JavaScript equivalents like -NaN, Infinity, -Infinity by default.

indent − It is used for good printing with a specified order.

separators − These are the ones used in the JSON.

default − this function is called when an object fails to serialized. It either returns object’s JSON-encoded version or throw a TypeError. If no type is given, a TypeError is defaulty thrown.

sort_keys − It’s default value is False. If true, the dictionaries’ output will be ordered/sorted by key.


The following program converts the given dictionary to a JSON file using the json.dump() function −

# importing json module import json # creating a dictionary inputDict = { "website": "Tutorialspoint", "authorName": "xyz", "Age": 25, "Address": "hyderabad", "pincode":"503004" } # opening a JSON file in write mode with open('outputfile.json', 'w') as json_file: # writing the dictionary data into the corresponding JSON file json.dump(inputDict, json_file) Output

On executing, the above program will generate the following output −

{"website": "Tutorialspoint", "authorName": "xyz", "Age": 25, "Address": "hyderabad", "pincode": "503004"}

A file named outputfile.json is created containing the above dictionary data.

Using the Indent Parameter

Use the indent parameter of the method dump() for attractive printing.


The following program converts the given dictionary to a pretty JSON file with indentation using the json.dump() function and indent argument −

# importing JSON module import json # creating a dictionary inputDict = { "website": "Tutorialspoint", "authorName": "xyz", "Age": 25, "Address": "hyderabad", "pincode":"503004" } # opening a JSON file in write mode with open('outputfile.json', 'w') as json_file: # writing the dictionary data into the corresponding JSON file # by adding indent parameter to make it attractive with proper indentation json.dump(inputDict, json_file, indent=5) Output

On executing, the above program will generate the following output −

{ "website": "Tutorialspoint", "authorName": "xyz", "Age": 25, "Address": "hyderabad", "pincode": "503004" }

A file named outputfile.json is created containing the above dictionary data with a proper indentation for making it more pretty.

Sorting the Keys in JSON

We can sort the keys of a dictionary alphabetically using the sort_keys = True parameter.

The following program converts the given dictionary to a sorted JSON file with indentation using the json.dump() function and sort_keys argument−

# importing JSON module import json # creating a dictionary inputDict = { "website": "Tutorialspoint", "authorName": "xyz", "Age": 25, "Address": "hyderabad", "pincode":"503004" } # opening a JSON file in write mode with open('outputfile.json', 'w') as json_file: # writing the dictionary data into the corresponding JSON file # indent parameter- to make it attractive with proper indentation # sort_keys- sorts the dictionary keys alphabetically json.dump(inputDict, json_file, indent=5, sort_keys=True) Output { "Address": "hyderabad", "Age": 25, "authorName": "xyz", "pincode": "503004", "website": "Tutorialspoint" }

The keys are now sorted alphabetically, as seen above.

Separators are an additional argument that can be used. In this, you can use any separator you like (“, “, “: “, “,”, “:”).

Converting Python List to JSON Example

The following program converts the python list to JSON string using dumps() function −

# importing JSON module import json # input list inputList = [2, 4, 6, 7] # converting input list into JSON string using dumps() function jsonString = json.dumps(inputList) # printing the resultant JSON string print(jsonString) # printing the type of resultant JSON string print(type(jsonString)) Output [2, 4, 6, 7] Converting Directories Python List to JSON Example

The following program converts the Directories python list to JSON string. using dumps() function −

# importing json module import json # input list of dictionaries list_dict = [{'x':10, 'y':20, 'z':30}, {'p':40, 'q':50}] # converting list of dictionaries into json string jsonData = json.dumps(list_dict) # printing the JSON data print(jsonData) Output [{"x": 10, "y": 20, "z": 30}, {"p": 40, "q": 50}] Converting Python List of Lists to JSON Example

The following program converts the Python List of Lists to JSON string using dumps() function −

# importing JSON module import json # input list of lists list_of_list = [[{'x':10, 'y':20, 'z':30}], [{'p':40, 'q':50}]] # converting a list of list into JSON string jsonString = json.dumps(list_of_list) # printing the resultant JSON string print(jsonString) Output

[[{"x": 10, "y": 20, "z": 30}], [{"p": 40, "q": 50}]]


This article contains a variety of techniques for converting various data formats to JSON files, JSON strings, etc. json.dumps(), which is used to convert any form of iterable to JSON, has also been covered in depth.

Update the detailed information about What Computer Do I Have? How To Check Specs & Model on the website. We hope the article's content will meet your needs, and we will regularly update the information to provide you with the fastest and most accurate information. Have a great day!