DDR 5th Mix's scoring system is insane. I get a headache thinking about it.
It is close to 3rd Mix is some ways, but different in others. In this mix,
the initial difficulty counter has the largest effect on your maximum score.
Also, there is a bonus applied at the end of the song based on your rank (ending bonus)
(AAA,AA,A,B,C,D,E)

First, the base score of a stage is determined by difficulty (this ranges from 1 to 9)

Let B = 500,000 + (number of "feet" difficulty * 500,000)

Which is the same as:

B = 500,000 * (the number of "feet" difficulty + 1)

Hence, a 8 foot difficulty song's maximum base score would be:

B = 500,000 * (8 + 1)
B = 4,500,000

However!!! If the song is a Long-Version song, we need to multiply the difficulty
by 2. Here is an example with a 7 foot difficulty song:

B = 500,000 * ((7*2) + 1)
B = 500,000 * 15
B = 7,500,000

Okay, the player gets bonuses per step based on how well the player is stepping

You get 10 times the base step value for a "Perfect",
5 times the base step value for a "Great",
All others; "Good", "Boo", "Miss", are worth 0.

Hence, if a player gets all "Perfect"s, on a 9 foot difficulty stage:

Max score = B * 10

= (500,000 * (9 + 1)) * 10
= 5,000,000 * 10
= 50,000,000

...And if this were a long version:

Max score = B * 10

= (500,000 * ((9 * 2) + 1)) * 10
= 500,000 * 19 * 10
= 95,000,000

An all "Great" Max Score is hence half the above.
All "EDIT" (homemade) data gets a rating of 7 steps regardless of content

A single step's points are calculated as follows:

Let p = score multiplier (Perfect = 10, Great = 5, other = 0)

N = total number of steps
n = number of the current step (varies from 1 to N)
B = base value of song (500K*(Difficulty+1))

So, the score for one step is:

StepScore = p * int(B/S) * n
Note: If your life bar becomes depleted, but you continue to play (due to Versus mode or Autofail off), P is changed to 1.

Where S = The sum of all integers from 1 to N (the total number of steps)

Now, through simple algebraic manipulation

S = 1+...+N = (1+N)*N/2 (1 through N added together)

This is very similar to how 3rd Mix scoring worked, except in 3rd Mix a normal mode
song always had a maximum value (all Perfect) of 10,000,000. Now the maximum value is based
on the song's Difficulty (not the number of steps). But the relative value of each step
is similar to 3rd Mix, with the later steps being worth more points, regardless of your
combo.

So, for example, suppose we wanted to calculate the step score of a "Perfect" on the 40th step
of a 350 step 8 step difficulty song (Not a Long-Version Song):

Remember this is just the score for the step, not the cumulative score up to the 40th step.

Also, there is a "bonus" for the final step of a song, that evens out the score to a multiple of 5,000,000 if you get all Perfects. This bonus is calculated as follows:

Bonus1 = 10 * (B - int(B/S) * N)
*Note: Only awarded when 'n' is equal to 'N'- the final step- this step must be Perfect in order to receive the bonus.

Now, your normal score accumulates during the game, but your bonus is awarded all at once at
the Results screen. There are two bonuses: a Combo Bonus and a Dance Level Bonus (note: the dance level bonus is only
received one time per song. Repeated plays of a song do not earn the dance level bonus, nor do songs from previous mixes (songs written in
blue letters)).

Your Combo Bonus goes up by (Q*C) after each step. So a Perfect on the first step of a
combo will add 55 to it, and a Perfect on the 100th step of a combo will add 5500 to
it. The maximum Combo Bonus for a song, which is from an all Perfect full-combo, is
55*S. [S is the same S calculated in the Step Score] For a 100 step song, this would be 277,750.
For a 400 step song, it would be 4,411,000.

Finally, your rank:

Each step has a value of two "Dance Points" assigned to it.
When you add them all up, you get the maximum number of possible "Dance Points". (Equal to 2 * N)

Your earned "Dance Points" are calculated as follows:

A "Perfect" is worth 2 points
A "Great" is worth 1 points
A "Good" is worth 0 points
A "Boo" will subtract 4 points
A "Miss" will subtract 5 points

The Dance Level Bonus is simple.

AAA = 10,000,000 (All Perfect)AA = 1,000,000 (All Perfect and Great)A = 100,000 (At least 80% of maximum Dance Points)B = 10,000 (At least 64% of maximum Dance Points)C = 1,000 (At least 50% of maximum Dance Points)D = 100 (Less than 50% of maximum Dance Points)
E = 0 (Failed)
*Note: A grade of AAA or AA override any other grade. If you have less than 80% of maximum Dance Points, but a Full Combo, the AA grade overrides the B. Likewise, if you do not have a Full Combo, the highest grade you can get is an A.

***Important Note: If your song is a Long Version, your Dance Level bonus is doubled!

The Combo Bonus doesn't have a huge effect on the score unless you get AA or AAA.

So there you have it. To finish, the best possible score (with bonuses) for a 9-step difficulty, 400 step song is:

Stage Score + Combo Bonus + Dance Level Bonus

= 50,000,000 + 4,411,000 + 10,000,000
= 64,411,000

5th Mix grading system derived by Taren N.

Point of Interest: In 5th Home Version's Information menu, there is an entry called "Total Score," which adds up all the entries from your records page. If you AAA every song on Basic, Trick, and Maniac on Single and Double, the highest this number will go is 13,118,666,300 points.